lkml.org 
[lkml]   [2020]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] USB: Remove dead code in usb_choose_configuration()
On Thu, 7 May 2020, Jason Yan wrote:

> This code is dead for more than 10 years. Remove it.
>
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
> ---
> drivers/usb/core/generic.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c
> index 4626227a6dd2..1c93192fc136 100644
> --- a/drivers/usb/core/generic.c
> +++ b/drivers/usb/core/generic.c
> @@ -93,12 +93,6 @@ int usb_choose_configuration(struct usb_device *udev)
> * be reinstated when device firmwares become more reliable.
> * Don't hold your breath.
> */
> -#if 0
> - /* Rule out self-powered configs for a bus-powered device */
> - if (bus_powered && (c->desc.bmAttributes &
> - USB_CONFIG_ATT_SELFPOWER))
> - continue;
> -#endif

Please don't remove this dead code. But if you insist on removing it
then you should make it part of the preceding comment -- otherwise
people reading the comment won't know what it's talking about.

And I really think removing both the code and the comment would be a
bad idea. If you do that, someday somebody will think that the code is
missing by accident and will add it in, causing problems for many other
people.

Alan Stern

\
 
 \ /
  Last update: 2020-05-07 15:33    [W:0.037 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site