software/bios/cmds/cmd_i2c: Use "%zu" to format size_t
The sizeof operator returns "size_t", which is defined to be "unsigned int" on 32-bit, and "unsigned long" on 64-bit. Format it using "%zu", to fix compiler warnings of the following type on 64-bit: warning: format '%d' expects argument of type 'int', but argument has type 'long unsigned int' [-Wformat=] Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:
parent
cbd54e7b5c
commit
ab8cee1b5e
|
@ -40,7 +40,7 @@ static void i2c_write_handler(int nb_params, char **params)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nb_params - 1 > sizeof(write_params)) {
|
if (nb_params - 1 > sizeof(write_params)) {
|
||||||
printf("Max data length is %d", sizeof(write_params));
|
printf("Max data length is %zu", sizeof(write_params));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ static void i2c_read_handler(int nb_params, char **params)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (len > sizeof(buf)) {
|
if (len > sizeof(buf)) {
|
||||||
printf("Max data count is %d", sizeof(buf));
|
printf("Max data count is %zu", sizeof(buf));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue