lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.2005070929060.7542-100000@netrider.rowland.org>
Date:   Thu, 7 May 2020 09:32:25 -0400 (EDT)
From:   Alan Stern <stern@...land.harvard.edu>
To:     Jason Yan <yanaijie@...wei.com>
cc:     gregkh@...uxfoundation.org, <hadess@...ess.net>,
        <linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [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@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ