linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wusb: use correct format characters
@ 2019-02-28 11:52 Louis Taylor
  2019-02-28 11:59 ` Greg KH
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Louis Taylor @ 2019-02-28 11:52 UTC (permalink / raw)
  To: gregkh
  Cc: linux-usb, linux-kernel, clang-built-linux, ndesaulniers, jflat,
	Louis Taylor

When compiling with -Wformat, clang warns:

./include/linux/usb/wusb.h:245:5: warning: format specifies type
'unsigned short' but the argument has type 'u8' (aka 'unsigned char')
[-Wformat]
  ckhdid->data[0],  ckhdid->data[1],
  ^~~~~~~~~~~~~~~

ckhdid->data is unconditionally defined as `u8 data[16]`, so this patch
updates the format characters to the correct one for unsigned char types.

Link: https://github.com/ClangBuiltLinux/linux/issues/378
Signed-off-by: Louis Taylor <louis@kragniz.eu>
---
 include/linux/usb/wusb.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/usb/wusb.h b/include/linux/usb/wusb.h
index 9e4a3213f2c2..0a3cdf10972d 100644
--- a/include/linux/usb/wusb.h
+++ b/include/linux/usb/wusb.h
@@ -240,8 +240,8 @@ static inline size_t ckhdid_printf(char *pr_ckhdid, size_t size,
 				   const struct wusb_ckhdid *ckhdid)
 {
 	return scnprintf(pr_ckhdid, size,
-			 "%02hx %02hx %02hx %02hx %02hx %02hx %02hx %02hx "
-			 "%02hx %02hx %02hx %02hx %02hx %02hx %02hx %02hx",
+			 "%02hhu %02hhu %02hhu %02hhu %02hhu %02hhu %02hhu %02hhu "
+			 "%02hhu %02hhu %02hhu %02hhu %02hhu %02hhu %02hhu %02hhu",
 			 ckhdid->data[0],  ckhdid->data[1],
 			 ckhdid->data[2],  ckhdid->data[3],
 			 ckhdid->data[4],  ckhdid->data[5],
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-03-05 16:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-28 11:52 [PATCH] wusb: use correct format characters Louis Taylor
2019-02-28 11:59 ` Greg KH
2019-02-28 12:24 ` [PATCH v2] " Louis Taylor
2019-02-28 19:19   ` Nick Desaulniers
2019-02-28 21:53   ` Joe Perches
2019-02-28 22:23     ` Jon Flatley
2019-02-28 23:05       ` Joe Perches
2019-03-01  0:03         ` Jon Flatley
2019-03-01  4:38           ` [PATCH] wusb: Remove unnecessary static function ckhdid_printf Joe Perches
2019-03-01 11:15             ` Louis Taylor
2019-03-01 18:18             ` Nick Desaulniers
2019-03-01 19:54               ` Greg KH
2019-03-05 16:21 ` [PATCH] wusb: use correct format characters Test
2019-03-05 16:28 ` Test

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).