Skip to content

Commit dbf2d02

Browse files
dnltznashif
authored andcommitted
drivers: led: Fix warnings in shell_print
Change format in various shell_error calls from int to long unsigned int. Warning: warning: format '%d' expects argument of type 'int', but argument 6 has type 'long unsigned int' Signed-off-by: Daniel Schultz <[email protected]>
1 parent 4151f0e commit dbf2d02

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/led/led_shell.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ static int cmd_set_brightness(const struct shell *shell,
142142
return -EINVAL;
143143
}
144144
if (value > 100) {
145-
shell_error(shell, "Invalid LED brightness value %d (max 100)",
145+
shell_error(shell, "Invalid LED brightness value %lu (max 100)",
146146
value);
147147
return -EINVAL;
148148
}
149149

150-
shell_print(shell, "%s: setting LED %d brightness to %d",
150+
shell_print(shell, "%s: setting LED %d brightness to %lu",
151151
dev->name, led, value);
152152

153153
err = led_set_brightness(dev, led, (uint8_t) value);
@@ -192,7 +192,7 @@ static int cmd_set_color(const struct shell *shell, size_t argc, char **argv)
192192
}
193193
if (col > 255) {
194194
shell_error(shell,
195-
"Invalid LED color value %d (max 255)",
195+
"Invalid LED color value %lu (max 255)",
196196
col);
197197
return -EINVAL;
198198
}
@@ -234,12 +234,12 @@ static int cmd_set_channel(const struct shell *shell, size_t argc, char **argv)
234234
return -EINVAL;
235235
}
236236
if (value > 255) {
237-
shell_error(shell, "Invalid channel value %d (max 255)",
237+
shell_error(shell, "Invalid channel value %lu (max 255)",
238238
value);
239239
return -EINVAL;
240240
}
241241

242-
shell_print(shell, "%s: setting channel %d to %d",
242+
shell_print(shell, "%s: setting channel %d to %lu",
243243
dev->name, channel, value);
244244

245245
err = led_set_channel(dev, channel, (uint8_t) value);
@@ -286,7 +286,7 @@ cmd_write_channels(const struct shell *shell, size_t argc, char **argv)
286286
}
287287
if (val > 255) {
288288
shell_error(shell,
289-
"Invalid channel value %d (max 255)", val);
289+
"Invalid channel value %lu (max 255)", val);
290290
return -EINVAL;
291291
}
292292
value[i] = val;

0 commit comments

Comments
 (0)