Skip to contentSkip to conversation

target: usb-gadget: cleanup duplicate initialization

PATCH Applied Dan Carpenter 2 participants 2 messages Apr 17, 2012 – Apr 18, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 target: usb-gadget: cleanup duplicate initialization

Sparse points out that we initialize .bAlternateSetting twice. But fortunately USB_G_ALT_INT_BBB is zero so we initialize it to the same value both times.

drivers/target/usb-gadget/usb_gadget.c +0 -1
index ba62bef..78aa37e 100644
@@ -1977,7 +1977,6 @@ static void usbg_deregister_configfs(void)
 static struct usb_interface_descriptor bot_intf_desc = {
 	.bLength =              sizeof(bot_intf_desc),
 	.bDescriptorType =      USB_DT_INTERFACE,
-	.bAlternateSetting =	0,
 	.bNumEndpoints =        2,
 	.bAlternateSetting =	USB_G_ALT_INT_BBB,
 	.bInterfaceClass =      USB_CLASS_MASS_STORAGE,
#1 lore raw
Quoted 11 lines · Dan Carpenter

Sparse points out that we initialize .bAlternateSetting twice. But fortunately USB_G_ALT_INT_BBB is zero so we initialize it to the same value both times.

drivers/target/usb-gadget/usb_gadget.c +0 -0
index ba62bef..78aa37e 100644

drivers/target/usb-gadget/usb_gadget.c static void usbg_deregister_configfs(void)

Quoted 8 lines
drivers/target/usb-gadget/usb_gadget.c +0 -2
@@ -1977,7 +1977,6 @@ static void usbg_deregister_configfs(void)
 static struct usb_interface_descriptor bot_intf_desc = {
 	.bLength =              sizeof(bot_intf_desc),
 	.bDescriptorType =      USB_DT_INTERFACE,
-	.bAlternateSetting =	0,
 	.bNumEndpoints =        2,
 	.bAlternateSetting =	USB_G_ALT_INT_BBB,
 	.bInterfaceClass =      USB_CLASS_MASS_STORAGE,
--

Applied. Thanks DanC!

--nab