Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac08de32 authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman
Browse files

usb: remove junk from store_remove_id



retval is 0, and carefully assigned - and tested as non zero.

This is not useful. While we are at it remove some other bogus initialisation
in the function

Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2bcb132c
Loading
Loading
Loading
Loading
+3 −8
Original line number Original line Diff line number Diff line
@@ -125,10 +125,9 @@ store_remove_id(struct device_driver *driver, const char *buf, size_t count)
{
{
	struct usb_dynid *dynid, *n;
	struct usb_dynid *dynid, *n;
	struct usb_driver *usb_driver = to_usb_driver(driver);
	struct usb_driver *usb_driver = to_usb_driver(driver);
	u32 idVendor = 0;
	u32 idVendor;
	u32 idProduct = 0;
	u32 idProduct;
	int fields = 0;
	int fields;
	int retval = 0;


	fields = sscanf(buf, "%x %x", &idVendor, &idProduct);
	fields = sscanf(buf, "%x %x", &idVendor, &idProduct);
	if (fields < 2)
	if (fields < 2)
@@ -141,14 +140,10 @@ store_remove_id(struct device_driver *driver, const char *buf, size_t count)
		    (id->idProduct == idProduct)) {
		    (id->idProduct == idProduct)) {
			list_del(&dynid->node);
			list_del(&dynid->node);
			kfree(dynid);
			kfree(dynid);
			retval = 0;
			break;
			break;
		}
		}
	}
	}
	spin_unlock(&usb_driver->dynids.lock);
	spin_unlock(&usb_driver->dynids.lock);

	if (retval)
		return retval;
	return count;
	return count;
}
}
static DRIVER_ATTR(remove_id, S_IRUGO | S_IWUSR, show_dynids, store_remove_id);
static DRIVER_ATTR(remove_id, S_IRUGO | S_IWUSR, show_dynids, store_remove_id);