Commit f60b99b1 authored by Karol Latecki's avatar Karol Latecki Committed by Tomasz Zawadzki
Browse files

scripts/gen_nvme.sh: remove unnecessary wrapper function



create_json_config_with_subsystems contents does not
need to be in a function. Moving it to main simplifies
--with-subsystems condition.

Signed-off-by: default avatarKarol Latecki <karol.latecki@intel.com>
Change-Id: I1414a209cc666ebb4639fc25133168482bd96c97
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8775


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent 65b3c34b
Loading
Loading
Loading
Loading
+12 −13
Original line number Diff line number Diff line
@@ -49,16 +49,6 @@ function create_json_config() {
	JSON
}

function create_json_config_with_subsystems() {
	cat <<- JSON
		{
			"subsystems": [
				$(create_json_config)
			]
		}
	JSON
}

while getopts 'h-:' optchar; do
	case "$optchar" in
		-)
@@ -73,8 +63,17 @@ while getopts 'h-:' optchar; do
	esac
done

bdev_json_cfg=$(create_json_config)
if [[ $gen_subsystems == true ]]; then
	create_json_config_with_subsystems
else
	create_json_config
	bdev_json_cfg=$(
		cat <<- JSON
			{
				"subsystems": [
					$bdev_json_cfg
				]
			}
		JSON
	)
fi

echo "$bdev_json_cfg"