diff mbox series

spi: spidev_test: Use %u to format unsigned numbers

Message ID 20200608100049.30648-1-geert+renesas@glider.be (mailing list archive)
State Accepted
Commit 9ec8ade812240f3ef553b5e8bfc74deec3f14339
Headers show
Series spi: spidev_test: Use %u to format unsigned numbers | expand

Commit Message

Geert Uytterhoeven June 8, 2020, 10 a.m. UTC
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>
---
 tools/spi/spidev_test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Mark Brown June 8, 2020, 12:46 p.m. UTC | #1
On Mon, 8 Jun 2020 12:00:49 +0200, Geert Uytterhoeven wrote:
> 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)
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: spidev_test: Use %u to format unsigned numbers
      commit: 9ec8ade812240f3ef553b5e8bfc74deec3f14339

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/tools/spi/spidev_test.c b/tools/spi/spidev_test.c
index eec23fa693bd5912..56ea053f72f2a276 100644
--- a/tools/spi/spidev_test.c
+++ b/tools/spi/spidev_test.c
@@ -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);