Skip to content

Commit 40992ab

Browse files
committed
fabrics: don't return config from merge_config
merge_config merges libnvme_fabrics_config into the controller object from the first argument. There is no need to return the config, and there is no user for it. Signed-off-by: Daniel Wagner <[email protected]>
1 parent 32cd510 commit 40992ab

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

libnvme/src/nvme/fabrics.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ static const struct libnvme_fabric_options default_supported_options = {
394394

395395
#define MERGE_CFG_OPTION(c, n, o, d) \
396396
if ((c)->o == d) (c)->o = (n)->o
397-
static struct libnvme_fabrics_config *merge_config(libnvme_ctrl_t c,
397+
static void merge_config(libnvme_ctrl_t c,
398398
const struct libnvme_fabrics_config *cfg)
399399
{
400400
struct libnvme_fabrics_config *ctrl_cfg = libnvme_ctrl_get_config(c);
@@ -417,8 +417,6 @@ static struct libnvme_fabrics_config *merge_config(libnvme_ctrl_t c,
417417
MERGE_CFG_OPTION(ctrl_cfg, cfg, data_digest, false);
418418
MERGE_CFG_OPTION(ctrl_cfg, cfg, tls, false);
419419
MERGE_CFG_OPTION(ctrl_cfg, cfg, concat, false);
420-
421-
return ctrl_cfg;
422420
}
423421

424422
#define UPDATE_CFG_OPTION(c, n, o, d) \
@@ -1051,7 +1049,7 @@ __public int libnvmf_add_ctrl(libnvme_host_t h, libnvme_ctrl_t c,
10511049
int ret;
10521050

10531051
/* highest prio have configs from command line */
1054-
cfg = merge_config(c, cfg);
1052+
merge_config(c, cfg);
10551053

10561054
/* apply configuration from config file (JSON) */
10571055
s = libnvme_lookup_subsystem(h, NULL, libnvme_ctrl_get_subsysnqn(c));
@@ -1070,7 +1068,7 @@ __public int libnvmf_add_ctrl(libnvme_host_t h, libnvme_ctrl_t c,
10701068
if (fc) {
10711069
const char *key;
10721070

1073-
cfg = merge_config(c, libnvme_ctrl_get_config(fc));
1071+
merge_config(c, libnvme_ctrl_get_config(fc));
10741072
/*
10751073
* An authentication key might already been set
10761074
* in @cfg, so ensure to update @c with the correct

0 commit comments

Comments
 (0)