Skip to content

Commit e048401

Browse files
geertudavem330
authored andcommitted
usb: hso: Fix debug compile warning on sparc32
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d99c6fa commit e048401

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/usb/hso.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,8 +1390,9 @@ static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old)
13901390
unsigned long flags;
13911391

13921392
if (old)
1393-
hso_dbg(0x16, "Termios called with: cflags new[%d] - old[%d]\n",
1394-
tty->termios.c_cflag, old->c_cflag);
1393+
hso_dbg(0x16, "Termios called with: cflags new[%u] - old[%u]\n",
1394+
(unsigned int)tty->termios.c_cflag,
1395+
(unsigned int)old->c_cflag);
13951396

13961397
/* the actual setup */
13971398
spin_lock_irqsave(&serial->serial_lock, flags);

0 commit comments

Comments
 (0)