Skip to content

Commit a89060b

Browse files
ndrs-pstkartben
authored andcommitted
drivers: i2c: shell: use shell_fprintf_normal instead of shell_fprintf
Due to the introduction of `shell_fprintf_normal` in PR #77192, we can minimize caller overhead by eliminating direct `color` parameter passing. Signed-off-by: Pisit Sawangvonganan <[email protected]>
1 parent 1991e57 commit a89060b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/i2c/i2c_shell.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ static int cmd_i2c_scan(const struct shell *sh, size_t argc, char **argv)
6262

6363
shell_print(sh, " 0 1 2 3 4 5 6 7 8 9 a b c d e f");
6464
for (uint8_t i = 0; i <= last; i += 16) {
65-
shell_fprintf(sh, SHELL_NORMAL, "%02x: ", i);
65+
shell_fprintf_normal(sh, "%02x: ", i);
6666
for (uint8_t j = 0; j < 16; j++) {
6767
if (i + j < first || i + j > last) {
68-
shell_fprintf(sh, SHELL_NORMAL, " ");
68+
shell_fprintf_normal(sh, " ");
6969
continue;
7070
}
7171

@@ -77,10 +77,10 @@ static int cmd_i2c_scan(const struct shell *sh, size_t argc, char **argv)
7777
msgs[0].len = 0U;
7878
msgs[0].flags = I2C_MSG_WRITE | I2C_MSG_STOP;
7979
if (i2c_transfer(dev, &msgs[0], 1, i + j) == 0) {
80-
shell_fprintf(sh, SHELL_NORMAL, "%02x ", i + j);
80+
shell_fprintf_normal(sh, "%02x ", i + j);
8181
++cnt;
8282
} else {
83-
shell_fprintf(sh, SHELL_NORMAL, "-- ");
83+
shell_fprintf_normal(sh, "-- ");
8484
}
8585
}
8686
shell_print(sh, "");

0 commit comments

Comments
 (0)