Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp936591imu; Wed, 23 Jan 2019 08:11:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN62T/mor5hsqeleAxvWC5r7fnAvwt6xXVj2lVgM24XhZI9qkvH0GLdqAG3rbfgE78hO8u81 X-Received: by 2002:a62:d206:: with SMTP id c6mr2467355pfg.245.1548259864871; Wed, 23 Jan 2019 08:11:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548259864; cv=none; d=google.com; s=arc-20160816; b=Pj/BELugedKtnAxzhZVUU0rP0Y++CGarGkDe5i+8fsyKu6hlIc+waOlYw0LIVAyUO2 vgBSfYZcbtA8NRF/JgO+WbDj22lJYlPIjqnPIYralycDFLO40LLHlFXwjuIhmpvgCzmp 6VSgZqr7SbhJsaw3eV6k4NbX6fyQs6E6FShdT6PUMTVkApYoFMtvecKC68bU0TL0gYKq gBG/Jmm7gujNRzCdO3GUfqNoDe71640/QBCACm5xdyXO9iC3AWrPIgigoDMToS2fyBQM pS6PnLVVjn9gMHfSMNRYmx8/RcXbAaq/K0nGhl73fEJcLm48NtMIlIMjIvNRY6td9pbf BW/Q== 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=sw/FGGdD0wcApqOcurs+PS3ga4ZzlGghCfhNMIV6q2k=; b=NfiecRgrhgFL3HivQOeOVfJLur2fi6EKEzWZBNQ60bWYzqtkrSfhKOkBIfvhDMOa3T 6wC1USXP2GHMUZHJsEwuz5ecNe2PQ4nq4+yVRavXdEZv7GVjkp6s3yEFiCD5yTDGfSN+ N4WbzwI69ByaOWGCM7mCYMEEueGEmShnLpsk0WAm5vL0+b/DnXaYDNwfBCsGMcq2b3Uc K2ByRwVbv0UdjfsTmYr81kIUNztSQNcd+IXwIr0neNQLGByVXlQ6pPBkac+lmaWUZ6pz iCFvaF+IVd5B7ij1cmpSq/F8iAIuByBfITC/4gqw95M077iQCaWFqnvw65nNGHxbS2wa +WkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t186si18749357pfd.68.2019.01.23.08.10.49; Wed, 23 Jan 2019 08:11:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726251AbfAWQJb (ORCPT + 99 others); Wed, 23 Jan 2019 11:09:31 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:49126 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726009AbfAWQJb (ORCPT ); Wed, 23 Jan 2019 11:09:31 -0500 Received: (qmail 2495 invoked by uid 2102); 23 Jan 2019 11:09:30 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 23 Jan 2019 11:09:30 -0500 Date: Wed, 23 Jan 2019 11:09:30 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: YueHaibing cc: geoff@infradead.org, , , , , , , Subject: Re: [PATCH -next] usb: host: drop pointless static qualifier In-Reply-To: <20190123083758.8412-1-yuehaibing@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 Wed, 23 Jan 2019, YueHaibing wrote: > There is no need to have the 'dummy_mask' variable static since new > value always be assigned before use it. > > Signed-off-by: YueHaibing > --- > drivers/usb/host/ehci-ps3.c | 2 +- > drivers/usb/host/ohci-ps3.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c > index 454d8c6..91cee02 100644 > --- a/drivers/usb/host/ehci-ps3.c > +++ b/drivers/usb/host/ehci-ps3.c > @@ -86,7 +86,7 @@ static int ps3_ehci_probe(struct ps3_system_bus_device *dev) > int result; > struct usb_hcd *hcd; > unsigned int virq; > - static u64 dummy_mask; > + u64 dummy_mask; > > if (usb_disabled()) { > result = -ENODEV; > diff --git a/drivers/usb/host/ohci-ps3.c b/drivers/usb/host/ohci-ps3.c > index 395f9d3..a1c1bdf 100644 > --- a/drivers/usb/host/ohci-ps3.c > +++ b/drivers/usb/host/ohci-ps3.c > @@ -69,7 +69,7 @@ static int ps3_ohci_probe(struct ps3_system_bus_device *dev) > int result; > struct usb_hcd *hcd; > unsigned int virq; > - static u64 dummy_mask; > + u64 dummy_mask; > > if (usb_disabled()) { > result = -ENODEV; No. You need to read the code and understand how a variable is used before you decide to modify it. In this case, a suitable approach would be to change the declaration so that it says: status u64 dummy_mask = DMA_BIT_MASK(32); and remove the line that does the assignment dynamically. Alan Stern