diff options
author | David Howells <dhowells@redhat.com> | 2008-07-02 07:28:55 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-21 18:16:44 -0400 |
commit | a80d5ff0d7d3a99e962a02c36acf97ba5a70b86e (patch) | |
tree | c8024d773006bf61126509cb8292d1341ac4dd2f /drivers/usb/core | |
parent | 4ddd9ec17af6a7c539f4a12758905340c00847d6 (diff) |
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 <stern@rowland.harvard.edu>
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 <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/devio.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 5580c6e59bae..54a350ccd033 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, | |||
552 | 552 | ||
553 | static int match_devt(struct device *dev, void *data) | 553 | static int match_devt(struct device *dev, void *data) |
554 | { | 554 | { |
555 | return (dev->devt == (dev_t) data); | 555 | return dev->devt == (dev_t) (unsigned long) data; |
556 | } | 556 | } |
557 | 557 | ||
558 | static struct usb_device *usbdev_lookup_by_devt(dev_t devt) | 558 | static struct usb_device *usbdev_lookup_by_devt(dev_t devt) |
559 | { | 559 | { |
560 | struct device *dev; | 560 | struct device *dev; |
561 | 561 | ||
562 | dev = bus_find_device(&usb_bus_type, NULL, (void *) devt, match_devt); | 562 | dev = bus_find_device(&usb_bus_type, NULL, |
563 | (void *) (unsigned long) devt, match_devt); | ||
563 | if (!dev) | 564 | if (!dev) |
564 | return NULL; | 565 | return NULL; |
565 | return container_of(dev, struct usb_device, dev); | 566 | return container_of(dev, struct usb_device, dev); |