Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp737209ybj; Thu, 7 May 2020 06:34:35 -0700 (PDT) X-Google-Smtp-Source: APiQypKdZrlzRofHGvuITX26zq0KzBcp5nSy+ttM5l4Wbctdlbiha+tThp5yCyQQCX4jvAyvZn6o X-Received: by 2002:a50:ec0c:: with SMTP id g12mr12331260edr.140.1588858475573; Thu, 07 May 2020 06:34:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588858475; cv=none; d=google.com; s=arc-20160816; b=tHMp8dSWQx8wkJyfKAXlS3XLvmbiKS+bEsl2OMmvj9H13rLtbJhmkfqfLn+4X+4LOf PUGL5HD2AVCw1zaJLCwqYCyqCNZmc5RxDPJE588amQLjnYVvdOudTyC8OTdgHQngOyPQ mEpZkQZ1eFlBuxYDNjTrPGArcKZROig+z11+uoz5QFSQJXXVBIW/vERcMqr39u4MO/kl fZDQ76A5hpf12+W5b+Z6zL2san8SheejvsYIhZIYsp1CKC49nEF8wi4jsSMUPlkfMlo1 Ie6X5UDcqjIb+sYwG+JtJR0jZLXbZ2WMGQNG48Nif4B5izkehm4cz+AKl6EZP+saGCUJ Y2dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=xYGm7BYE3GiHFgzCgo7mBFvIp7Hg/MjHiu/FFaIaMww=; b=isNWZaAOVJ3SWYsumPrdXjDhxp2lglzcmuSoFG0xgkqjpNLu4HPIYuByHfBtgMXiWH ihHkN8WPpXyJOhm2/Rz6xDyminr/0IcEY98mBlSEHtpl2ts+2I2FPC3fetnX5MRAuiKy FwfpqlG0G8SPF69csrsZ1NYZXxEQgFmE7HJ9GbjpCauPfzkhUD8Ra61TxrR/gdmr6aX9 F1nXFhMcmY+f109kmbmXrEtJqLGcIaZhHHxbdoq+106U6xgFfOad5k5UcBlEeQ55mCpL yQy8JdS29Nim7176dSyqWhO4WJmbVmUpFvDYhtMw5Cnd3lVCh6OlRNeMs5y1rCeKKWrS ulZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay15si3225275ejb.1.2020.05.07.06.34.05; Thu, 07 May 2020 06:34:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726367AbgEGNc0 (ORCPT + 99 others); Thu, 7 May 2020 09:32:26 -0400 Received: from netrider.rowland.org ([192.131.102.5]:38421 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726093AbgEGNc0 (ORCPT ); Thu, 7 May 2020 09:32:26 -0400 Received: (qmail 8873 invoked by uid 500); 7 May 2020 09:32:25 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 7 May 2020 09:32:25 -0400 Date: Thu, 7 May 2020 09:32:25 -0400 (EDT) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: Jason Yan cc: gregkh@linuxfoundation.org, , , Subject: Re: [PATCH] USB: Remove dead code in usb_choose_configuration() In-Reply-To: <20200507110723.37669-1-yanaijie@huawei.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 7 May 2020, Jason Yan wrote: > This code is dead for more than 10 years. Remove it. > > Signed-off-by: Jason Yan > --- > 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