Spdk/lib/init
Jim Harris 9c10093483 init: rewrite subsystem_sort
Commit aaba5d introduced a build warning with some
compilers. While fixing it, I realized the function was
difficult to immediately understand. So in addition to fixing
the build warning, I also made the following changes:

* Improved names for local variables
* Use TAILQ_INIT for local TAILQ instead of TAILQ_HEAD_INITIALIZER.
* Add comments explaining more clearly what the nested loops are
  doing.
* Use TAILQ_SWAP instead of a FOREACH + REMOVE + INSERT.

Fixes: aaba5d ("subsystem: Gather list changed conditions.")
Fixes issue #2978.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic8740b5706537938d62a0acfac62625b2424b85f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17496
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Mike Gerdts <mgerdts@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2023-05-09 17:58:11 +08:00
..
json_config.c misc: Fix spelling mistakes 2022-12-09 08:16:18 +00:00
Makefile so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
rpc.c update Intel copyright notices 2022-11-10 08:28:53 +00:00
spdk_init.map event: Move json config loading to init 2021-05-26 09:13:34 +00:00
subsystem_rpc.c rpc: print device type in framework_get_pci_devices 2022-11-21 16:15:44 +00:00
subsystem.c init: rewrite subsystem_sort 2023-05-09 17:58:11 +08:00
subsystem.h update Intel copyright notices 2022-11-10 08:28:53 +00:00