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>
This commit is contained in:

committed by
John W. Linville

parent
d74f5ba473
commit
c1d35dfa0f
@@ -26,6 +26,12 @@
|
||||
#ifndef RT2X00USB_H
|
||||
#define RT2X00USB_H
|
||||
|
||||
#define to_usb_device_intf(d) \
|
||||
({ \
|
||||
struct usb_interface *intf = to_usb_interface(d); \
|
||||
interface_to_usbdev(intf); \
|
||||
})
|
||||
|
||||
/*
|
||||
* This variable should be used with the
|
||||
* usb_driver structure initialization.
|
||||
|
Reference in New Issue
Block a user