[PATCH] usb: hso: Fix debug compile warning on sparc32

From: Geert Uytterhoeven
Date: Mon Jul 13 2020 - 07:05:22 EST


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@xxxxxxxxxxxxxx>
---
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