From: David Howells Date: Wed, 2 Jul 2008 11:28:55 +0000 (+0100) Subject: USB: Fix pointer/int cast in USB devio code X-Git-Tag: v2.6.27-rc1~946^2~9 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=a80d5ff0d7d3a99e962a02c36acf97ba5a70b86e;p=linux-2.6-omap-h63xx.git USB: Fix pointer/int cast in USB devio code Fix pointer/int cast in USB devio code, and thus avoid a compiler warning. A void* data argument passed to bus_find_device() and thence to match_devt() is used to carry a 32-bit datum. However, casting directly between a u32 and a pointer is not permitted - there must be an intermediate cast via (unsigned) long. This was introduced by the following patch: commit 94b1c9fa060ece2c8f080583beb6cc6008e41413 Author: Alan Stern Date: Tue Jun 24 14:47:12 2008 -0400 usbfs: simplify the lookup-by-minor routines This patch (as1105) simplifies the lookup-by-minor-number code in usbfs. Instead of passing the minor number to the callback, which must then reconstruct the entire dev_t value, the patch passes the dev_t value directly. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman Signed-off-by: David Howells Cc: Alan Stern Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 5580c6e59ba..54a350ccd03 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -552,14 +552,15 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype, static int match_devt(struct device *dev, void *data) { - return (dev->devt == (dev_t) data); + return dev->devt == (dev_t) (unsigned long) data; } static struct usb_device *usbdev_lookup_by_devt(dev_t devt) { struct device *dev; - dev = bus_find_device(&usb_bus_type, NULL, (void *) devt, match_devt); + dev = bus_find_device(&usb_bus_type, NULL, + (void *) (unsigned long) devt, match_devt); if (!dev) return NULL; return container_of(dev, struct usb_device, dev);