lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Sun, 1 Oct 2006 07:24:33 -0400
From:	Jeff Garzik <jeff@...zik.org>
To:	Greg KH <greg@...ah.com>
Cc:	Andrew Morton <akpm@...l.org>, LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] usb/serial/mos7840: fix cast


Debug code in mos7840 emits the following warnings on 64-bit:

drivers/usb/serial/mos7840.c: In function ‘mos7840_open’:
drivers/usb/serial/mos7840.c:1091: warning: cast from pointer to integer of different size
drivers/usb/serial/mos7840.c:1091: warning: cast from pointer to integer of different size
drivers/usb/serial/mos7840.c:1091: warning: cast from pointer to integer of different size

Solution:  Don't assume pointers are 32-bit.  The easy solution actually
cleans up the code:  "%p" (pointer) permits us to eliminate the casts,
and print correct debug information on 64-bit.

Signed-off-by: Jeff Garzik <jeff@...zik.org>

diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 95bf571..117fe5f 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -1088,7 +1088,7 @@ static int mos7840_open(struct usb_seria
 	mos7840_port->icount.tx = 0;
 	mos7840_port->icount.rx = 0;
 
-	dbg("\n\nusb_serial serial:%x       mos7840_port:%x\n      usb_serial_port port:%x\n\n", (unsigned int)serial, (unsigned int)mos7840_port, (unsigned int)port);
+	dbg("\n\nusb_serial serial:%p       mos7840_port:%p\n      usb_serial_port port:%p\n\n", serial, mos7840_port, port);
 
 	return 0;
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ