Skip to content

Commit

Permalink
mgmtd: clean up -Wshadow warnings
Browse files Browse the repository at this point in the history
Clean up various variable-shadow warnings in mgmtd.

Signed-off-by: Mark Stapp <[email protected]>
  • Loading branch information
Mark Stapp committed Jan 24, 2025
1 parent cba3479 commit 565b853
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
21 changes: 10 additions & 11 deletions mgmtd/mgmt_ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ void mgmt_ds_reset_candidate(void)
}


int mgmt_ds_init(struct mgmt_master *mm)
int mgmt_ds_init(struct mgmt_master *m)
{
if (mgmt_ds_mm || mm->running_ds || mm->candidate_ds || mm->oper_ds)
if (mgmt_ds_mm || m->running_ds || m->candidate_ds || m->oper_ds)
assert(!"MGMTD: Call ds_init only once!");

/* Use Running DS from NB module??? */
Expand All @@ -178,10 +178,10 @@ int mgmt_ds_init(struct mgmt_master *mm)
oper.config_ds = false;
oper.ds_id = MGMTD_DS_OPERATIONAL;

mm->running_ds = &running;
mm->candidate_ds = &candidate;
mm->oper_ds = &oper;
mgmt_ds_mm = mm;
m->running_ds = &running;
m->candidate_ds = &candidate;
m->oper_ds = &oper;
mgmt_ds_mm = m;

return 0;
}
Expand All @@ -195,16 +195,15 @@ void mgmt_ds_destroy(void)
oper.root.dnode_root = NULL;
}

struct mgmt_ds_ctx *mgmt_ds_get_ctx_by_id(struct mgmt_master *mm,
Mgmtd__DatastoreId ds_id)
struct mgmt_ds_ctx *mgmt_ds_get_ctx_by_id(struct mgmt_master *m, Mgmtd__DatastoreId ds_id)
{
switch (ds_id) {
case MGMTD_DS_CANDIDATE:
return (mm->candidate_ds);
return (m->candidate_ds);
case MGMTD_DS_RUNNING:
return (mm->running_ds);
return (m->running_ds);
case MGMTD_DS_OPERATIONAL:
return (mm->oper_ds);
return (m->oper_ds);
case MGMTD_DS_NONE:
case MGMTD__DATASTORE_ID__STARTUP_DS:
case _MGMTD__DATASTORE_ID_IS_INT_SIZE:
Expand Down
1 change: 0 additions & 1 deletion mgmtd/mgmt_fe_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,6 @@ static void fe_adapter_handle_get_data(struct mgmt_fe_session_ctx *session,
/* Check for yang-library shortcut */
if (nb_oper_is_yang_lib_query(msg->xpath)) {
struct lyd_node *ylib = NULL;
LY_ERR err;

err = ly_ctx_get_yanglib_data(ly_native_ctx, &ylib, "%u",
ly_ctx_get_change_count(
Expand Down
12 changes: 6 additions & 6 deletions mgmtd/mgmt_txn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1992,17 +1992,17 @@ static void mgmt_txn_register_event(struct mgmt_txn_ctx *txn,
}
}

int mgmt_txn_init(struct mgmt_master *mm, struct event_loop *tm)
int mgmt_txn_init(struct mgmt_master *m, struct event_loop *loop)
{
if (mgmt_txn_mm || mgmt_txn_tm)
assert(!"MGMTD TXN: Call txn_init() only once");

mgmt_txn_mm = mm;
mgmt_txn_tm = tm;
mgmt_txns_init(&mm->txn_list);
mgmt_txn_mm = m;
mgmt_txn_tm = loop;
mgmt_txns_init(&m->txn_list);
mgmt_txn_hash_init();
assert(!mm->cfg_txn);
mm->cfg_txn = NULL;
assert(!m->cfg_txn);
m->cfg_txn = NULL;

return 0;
}
Expand Down

0 comments on commit 565b853

Please sign in to comment.