Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: core: Remove unnecessary memset()

register_root_hub() calls memset() setting usb_dev->bus->devmap.
devicemap to 0 during hcd probe function (usb_hcd_pci_probe). But
in previous function which is also the procedure of usb_hcd_pci_probe(),
usb_bus_init() already initialized bus->devmap calling memset().
Furthermore, register_root_hub() is called only once in kernel.
So, calling memset() which resets usb_bus->devmap.devicemap in
register_root_hub() is redundant.

Signed-off-by: Suwan Kim <suwan.kim027@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Suwan Kim and committed by
Greg Kroah-Hartman
c238ec3e 9e412c66

-2
-2
drivers/usb/core/hcd.c
··· 1074 1074 1075 1075 usb_dev->devnum = devnum; 1076 1076 usb_dev->bus->devnum_next = devnum + 1; 1077 - memset (&usb_dev->bus->devmap.devicemap, 0, 1078 - sizeof usb_dev->bus->devmap.devicemap); 1079 1077 set_bit (devnum, usb_dev->bus->devmap.devicemap); 1080 1078 usb_set_device_state(usb_dev, USB_STATE_ADDRESS); 1081 1079