All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: hso: Fix debug compile warning on sparc32
@ 2020-07-13 11:05 Geert Uytterhoeven
  2020-07-14  0:03 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2020-07-13 11:05 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski
  Cc: Greg Kroah-Hartman, linux-usb, netdev, linux-kernel, Geert Uytterhoeven

On sparc32, tcflag_t is "unsigned long", unlike on all other
architectures, where it is "unsigned int":

    drivers/net/usb/hso.c: In function ‘hso_serial_set_termios’:
    include/linux/kern_levels.h:5:18: warning: format ‘%d’ expects argument of type ‘unsigned int’, but argument 4 has type ‘tcflag_t {aka long unsigned int}’ [-Wformat=]
    drivers/net/usb/hso.c:1393:3: note: in expansion of macro ‘hso_dbg’
       hso_dbg(0x16, "Termios called with: cflags new[%d] - old[%d]\n",
       ^~~~~~~
    include/linux/kern_levels.h:5:18: warning: format ‘%d’ expects argument of type ‘unsigned int’, but argument 5 has type ‘tcflag_t {aka long unsigned int}’ [-Wformat=]
    drivers/net/usb/hso.c:1393:3: note: in expansion of macro ‘hso_dbg’
       hso_dbg(0x16, "Termios called with: cflags new[%d] - old[%d]\n",
       ^~~~~~~

As "unsigned long" is 32-bit on sparc32, fix this by casting all tcflag_t
parameters to "unsigned int".
While at it, use "%u" to format unsigned numbers.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/net/usb/hso.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index bb8c34d746ab33a8..5f123a8cf68ed920 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -1390,8 +1390,9 @@ static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old)
 	unsigned long flags;
 
 	if (old)
-		hso_dbg(0x16, "Termios called with: cflags new[%d] - old[%d]\n",
-			tty->termios.c_cflag, old->c_cflag);
+		hso_dbg(0x16, "Termios called with: cflags new[%u] - old[%u]\n",
+			(unsigned int)tty->termios.c_cflag,
+			(unsigned int)old->c_cflag);
 
 	/* the actual setup */
 	spin_lock_irqsave(&serial->serial_lock, flags);
-- 
2.17.1


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

* Re: [PATCH] usb: hso: Fix debug compile warning on sparc32
  2020-07-13 11:05 [PATCH] usb: hso: Fix debug compile warning on sparc32 Geert Uytterhoeven
@ 2020-07-14  0:03 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-07-14  0:03 UTC (permalink / raw)
  To: geert; +Cc: kuba, gregkh, linux-usb, netdev, linux-kernel

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Mon, 13 Jul 2020 13:05:13 +0200

> On sparc32, tcflag_t is "unsigned long", unlike on all other
> architectures, where it is "unsigned int":
> 
>     drivers/net/usb/hso.c: In function ‘hso_serial_set_termios’:
>     include/linux/kern_levels.h:5:18: warning: format ‘%d’ expects argument of type ‘unsigned int’, but argument 4 has type ‘tcflag_t {aka long unsigned int}’ [-Wformat=]
>     drivers/net/usb/hso.c:1393:3: note: in expansion of macro ‘hso_dbg’
>        hso_dbg(0x16, "Termios called with: cflags new[%d] - old[%d]\n",
>        ^~~~~~~
>     include/linux/kern_levels.h:5:18: warning: format ‘%d’ expects argument of type ‘unsigned int’, but argument 5 has type ‘tcflag_t {aka long unsigned int}’ [-Wformat=]
>     drivers/net/usb/hso.c:1393:3: note: in expansion of macro ‘hso_dbg’
>        hso_dbg(0x16, "Termios called with: cflags new[%d] - old[%d]\n",
>        ^~~~~~~
> 
> As "unsigned long" is 32-bit on sparc32, fix this by casting all tcflag_t
> parameters to "unsigned int".
> While at it, use "%u" to format unsigned numbers.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Applied, thanks.

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

end of thread, other threads:[~2020-07-14  0:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-13 11:05 [PATCH] usb: hso: Fix debug compile warning on sparc32 Geert Uytterhoeven
2020-07-14  0:03 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.