From f60b99b16821d22257d01451aab923ea525747a8 Mon Sep 17 00:00:00 2001 From: Karol Latecki Date: Tue, 13 Jul 2021 19:23:15 +0200 Subject: [PATCH] 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: Karol Latecki Change-Id: I1414a209cc666ebb4639fc25133168482bd96c97 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8775 Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Paul Luse Reviewed-by: Jim Harris Reviewed-by: Changpeng Liu --- scripts/gen_nvme.sh | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/scripts/gen_nvme.sh b/scripts/gen_nvme.sh index f06d73c1a..0c983390c 100755 --- a/scripts/gen_nvme.sh +++ b/scripts/gen_nvme.sh @@ -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"