diff options
author | Lifang Zhang <lifang.zhang@nokia.com> | 2021-08-18 14:18:43 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2021-09-30 14:27:54 +0300 |
commit | efce6d4192737480e65cbfdca2808bebcfe1eb66 (patch) | |
tree | 06a3a1332cc13bfefbb45af94ef252ad13a1d1bc /helper | |
parent | e7c20893428f9d1a91d46118c8c0cda0e3d5c4eb (diff) |
helper: cli: delete max_user_commands from struct cli_shm_t
After adding odph_cli_param_t to struct cli_shm_t in the previous
commit, max_user_commands is redundant since it is also included
in struct odph_cli_param_t.
Signed-off-by: Lifang Zhang <lifang.zhang@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Diffstat (limited to 'helper')
-rw-r--r-- | helper/cli.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/helper/cli.c b/helper/cli.c index a139ec2b7..9efa79225 100644 --- a/helper/cli.c +++ b/helper/cli.c @@ -46,7 +46,6 @@ typedef struct { odp_instance_t instance; odph_cli_param_t cli_param; struct sockaddr_in addr; - uint32_t max_user_commands; uint32_t num_user_commands; user_cmd_t user_cmd[0]; } cli_shm_t; @@ -117,8 +116,6 @@ int odph_cli_init(odp_instance_t instance, const odph_cli_param_t *param) break; } - shm->max_user_commands = param->max_user_commands; - if (socketpair(PF_LOCAL, SOCK_STREAM, 0, shm->sp)) { ODPH_ERR("Error: socketpair(): %s\n", strerror(errno)); return -1; @@ -149,7 +146,7 @@ int odph_cli_register_command(const char *name, odph_cli_user_cmd_func_t func, } odp_spinlock_unlock(&shm->lock); - if (shm->num_user_commands >= shm->max_user_commands) { + if (shm->num_user_commands >= shm->cli_param.max_user_commands) { ODPH_ERR("Error: maximum number of user commands already registered\n"); goto error; } |