Skip to contentSkip to conversation

USB: remove dead code from usb_deregister_dev()

PATCH Superseded Libor Pechacek 2 participants 5 messages Mar 24, 2011 – Mar 25, 2011 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: remove dead code from usb_deregister_dev()

The `name' variable is unused in usb_deregister_dev() since commit d6e5bcf.

---
 drivers/usb/core/file.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)
drivers/usb/core/file.c +0 -8
index cf6a542..99458c8 100644
@@ -236,13 +236,6 @@ EXPORT_SYMBOL_GPL(usb_register_dev);
 void usb_deregister_dev(struct usb_interface *intf,
 			struct usb_class_driver *class_driver)
 {
-	int minor_base = class_driver->minor_base;
-	char name[20];
-
-#ifdef CONFIG_USB_DYNAMIC_MINORS
-	minor_base = 0;
-#endif
-
 	if (intf->minor == -1)
 		return;
 
@@ -252,7 +245,6 @@ void usb_deregister_dev(struct usb_interface *intf,
 	usb_minors[intf->minor] = NULL;
 	up_write(&minor_rwsem);
 
-	snprintf(name, sizeof(name), class_driver->name, intf->minor - minor_base);
 	device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor));
 	intf->usb_dev = NULL;
 	intf->minor = -1;
Signature · 1 line
1.6.0.2
#1 lore raw

Hello.

Quoted 1 line · Libor Pechacek

The `name' variable is unused in usb_deregister_dev() since commit d6e5bcf.

Please also specify that commit's summary in parens for the human readers,
as asked by Linus.

Quoted 1 line

WBR, Sergei

#2 lore raw
Quoted 5 lines · Sergei Shtylyov
Quoted 1 line · Libor Pechacek

The `name' variable is unused in usb_deregister_dev() since commit d6e5bcf.

Please also specify that commit's summary in parens for the human
readers,

OK, sounds sane. Updated patch will follow.

Quoted 1 line

as asked by Linus.

Can you please post a reference to the thread? I'd like to read it but can't find it.

Libor

Signature · 2 lines
Libor Pechacek
SUSE L3 Team, Prague
#3 lore raw

Hello.

Quoted 11 lines · Libor Pechacek
Quoted 4 lines
Quoted 1 line

The `name' variable is unused in usb_deregister_dev() since commit d6e5bcf.

Please also specify that commit's summary in parens for the human
readers,

OK, sounds sane. Updated patch will follow.

Quoted 1 line

as asked by Linus.

Can you please post a reference to the thread? I'd like to read it but can't find it.

No, sorry, can't -- that was long ago, and I didn't save it.

Quoted 1 line

Libor

WBR, Sergei

#4 lore raw

PATCH v2 1/1 USB: remove dead code from usb_deregister_dev()

In reply to Libor Pechacek

The `name' variable is unused in usb_deregister_dev() since commit d6e5bcf (devfs: Remove the mode field from usb_class_driver as it's no longer needed).

---
 drivers/usb/core/file.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)
drivers/usb/core/file.c +0 -8
index cf6a542..99458c8 100644
@@ -236,13 +236,6 @@ EXPORT_SYMBOL_GPL(usb_register_dev);
 void usb_deregister_dev(struct usb_interface *intf,
 			struct usb_class_driver *class_driver)
 {
-	int minor_base = class_driver->minor_base;
-	char name[20];
-
-#ifdef CONFIG_USB_DYNAMIC_MINORS
-	minor_base = 0;
-#endif
-
 	if (intf->minor == -1)
 		return;
 
@@ -252,7 +245,6 @@ void usb_deregister_dev(struct usb_interface *intf,
 	usb_minors[intf->minor] = NULL;
 	up_write(&minor_rwsem);
 
-	snprintf(name, sizeof(name), class_driver->name, intf->minor - minor_base);
 	device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor));
 	intf->usb_dev = NULL;
 	intf->minor = -1;
Signature · 1 line
1.6.0.2