Skip to content

Commit 42da6c9

Browse files
XenuIsWatchingMaureenHelm
authored andcommitted
drivers: i3c: shell: fix argc count for setmrl
There is the wrong argc count for the max ibi len for setmrl. Signed-off-by: Ryan McClelland <[email protected]>
1 parent f9ba776 commit 42da6c9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/i3c/i3c_shell.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -866,13 +866,13 @@ static int cmd_i3c_ccc_setmrl(const struct shell *sh, size_t argc, char **argv)
866866
}
867867

868868
/* IBI length is required if the ibi payload bit is set */
869-
if ((desc->bcr & I3C_BCR_IBI_PAYLOAD_HAS_DATA_BYTE) && (argc < 4)) {
869+
if ((desc->bcr & I3C_BCR_IBI_PAYLOAD_HAS_DATA_BYTE) && (argc < 5)) {
870870
shell_error(sh, "I3C: Missing IBI length.");
871871
return -EINVAL;
872872
}
873873

874874
mrl.len = strtol(argv[3], NULL, 16);
875-
if (argc > 3) {
875+
if (argc > 4) {
876876
mrl.ibi_len = strtol(argv[4], NULL, 16);
877877
}
878878

@@ -883,7 +883,7 @@ static int cmd_i3c_ccc_setmrl(const struct shell *sh, size_t argc, char **argv)
883883
}
884884

885885
desc->data_length.mrl = mrl.len;
886-
if (argc > 3) {
886+
if (argc > 4) {
887887
desc->data_length.max_ibi = mrl.ibi_len;
888888
}
889889

0 commit comments

Comments
 (0)