summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00usb.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-06-16 19:57:11 +0200
committerJohn W. Linville <linville@tuxdriver.com>2008-06-26 16:49:16 -0400
commitc1d35dfa0f7d75ba14c442143a9ad8e232d3edfb (patch)
tree9266a9be1068c66b6c80f0f5a73e47af88acd584 /drivers/net/wireless/rt2x00/rt2x00usb.c
parentd74f5ba473b915e5d4ea1ed391984bb62d9de8b1 (diff)
downloadlinux-c1d35dfa0f7d75ba14c442143a9ad8e232d3edfb.tar.gz
linux-c1d35dfa0f7d75ba14c442143a9ad8e232d3edfb.tar.bz2
linux-c1d35dfa0f7d75ba14c442143a9ad8e232d3edfb.zip
rt2x00: Fix sparse warning on nested container_of()
Sparse produces warnings about nested contain_of() statements, this means that lines like: interface_to_usbdev(to_usb_interface(rt2x00dev->dev)); will upset sparse. Add a new macro to rt2x00usb.h which will convert to device structure to the usb_device pointer in 2 steps to prevent this sparse warning. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index b94c461fbaf9..5593b9a83108 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -40,8 +40,7 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev,
void *buffer, const u16 buffer_length,
const int timeout)
{
- struct usb_device *usb_dev =
- interface_to_usbdev(to_usb_interface(rt2x00dev->dev));
+ struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev);
int status;
unsigned int i;
unsigned int pipe =
@@ -162,8 +161,7 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)
int rt2x00usb_write_tx_data(struct queue_entry *entry)
{
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
- struct usb_device *usb_dev =
- interface_to_usbdev(to_usb_interface(rt2x00dev->dev));
+ struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev);
struct queue_entry_priv_usb *entry_priv = entry->priv_data;
struct skb_frame_desc *skbdesc;
u32 length;
@@ -319,8 +317,7 @@ EXPORT_SYMBOL_GPL(rt2x00usb_disable_radio);
void rt2x00usb_init_rxentry(struct rt2x00_dev *rt2x00dev,
struct queue_entry *entry)
{
- struct usb_device *usb_dev =
- interface_to_usbdev(to_usb_interface(rt2x00dev->dev));
+ struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev);
struct queue_entry_priv_usb *entry_priv = entry->priv_data;
usb_fill_bulk_urb(entry_priv->urb, usb_dev,