Bluetooth: Audio: Shell: Fix use of IN_RANGE when MIN is 0
If the minimal value of an IN_RANGE is 0, then it is a useless check, and the cases have been modified to not use IN_RANGE. This also fixes some coverity issues. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
4e1020e742
commit
ba7fde1bae
2 changed files with 4 additions and 4 deletions
|
@ -453,7 +453,7 @@ static int cmd_bap_broadcast_assistant_add_src(const struct shell *sh,
|
|||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
if (!IN_RANGE(bis_sync, 0, UINT32_MAX)) {
|
||||
if (bis_sync > UINT32_MAX) {
|
||||
shell_error(sh, "Invalid bis_sync: %lu", bis_sync);
|
||||
|
||||
return -ENOEXEC;
|
||||
|
@ -630,7 +630,7 @@ static int cmd_bap_broadcast_assistant_add_broadcast_id(const struct shell *sh,
|
|||
shell_error(sh, "failed to parse bis_sync: %d", err);
|
||||
|
||||
return -ENOEXEC;
|
||||
} else if (!IN_RANGE(bis_sync, 0, UINT32_MAX)) {
|
||||
} else if (bis_sync > UINT32_MAX) {
|
||||
shell_error(sh, "Invalid bis_sync: %lu", bis_sync);
|
||||
|
||||
return -ENOEXEC;
|
||||
|
@ -727,7 +727,7 @@ static int cmd_bap_broadcast_assistant_mod_src(const struct shell *sh,
|
|||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
if (!IN_RANGE(bis_sync, 0, UINT32_MAX)) {
|
||||
if (bis_sync > UINT32_MAX) {
|
||||
shell_error(sh, "Invalid bis_sync: %lu", bis_sync);
|
||||
|
||||
return -ENOEXEC;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue