From 555f15deaa798e61d0d84f7bd6cbb877179e129e Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Tue, 8 Mar 2022 11:02:32 +0100 Subject: [PATCH] Shell: shell.c Use IN_RANGE macro from util.h Change an occurence of `in_range` to use the IN_RANGE macro. Signed-off-by: Emil Gydesen --- subsys/shell/shell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/shell/shell.c b/subsys/shell/shell.c index abeac7a59e8..291a0fb3396 100644 --- a/subsys/shell/shell.c +++ b/subsys/shell/shell.c @@ -539,7 +539,7 @@ static int exec_cmd(const struct shell *shell, size_t argc, const char **argv, uint8_t opt8 = shell->ctx->active_cmd.args.optional; uint32_t opt = (opt8 == SHELL_OPT_ARG_CHECK_SKIP) ? UINT16_MAX : opt8; - bool in_range = (argc >= mand) && (argc <= (mand + opt)); + const bool in_range = IN_RANGE(argc, mand, mand + opt); /* Check if argc is within allowed range */ ret_val = cmd_precheck(shell, in_range);