Skip to content

Commit

Permalink
spi: spidev_test: Use %u to format unsigned numbers
Browse files Browse the repository at this point in the history
Consistently use %u to format unsigned numbers.
For "bits" this doesn't matter that much, as it is "uint8_t".
However, "speed" is "uint32_t", so in case people use "-s -1" to force
the maximum, they would see:

    max speed: -1 Hz (4294967 KHz)

While at it, use "k" (kilo) instead of "K" (kelvin) in "kHz".

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20200608100049.30648-1-geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Geert Uytterhoeven authored and Mark Brown committed Jun 8, 2020
1 parent 8bdd79d commit 9ec8ade
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/spi/spidev_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,8 @@ int main(int argc, char *argv[])
pabort("can't get max speed hz");

printf("spi mode: 0x%x\n", mode);
printf("bits per word: %d\n", bits);
printf("max speed: %d Hz (%d KHz)\n", speed, speed/1000);
printf("bits per word: %u\n", bits);
printf("max speed: %u Hz (%u kHz)\n", speed, speed/1000);

if (input_tx)
transfer_escaped_string(fd, input_tx);
Expand Down

0 comments on commit 9ec8ade

Please sign in to comment.