Message ID | a3c703152d89a2c6b34b31f0158f84ba504e24d8.1679434951.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2028286wrt; Tue, 21 Mar 2023 14:53:42 -0700 (PDT) X-Google-Smtp-Source: AKy350bONxLfv62ZXJY5DFO2hbr2t/a9yX38FueZjO6HOmmNCqXAEsjYqVq4CLFkKWaD33Qv6JTi X-Received: by 2002:a17:903:22d2:b0:19c:dd49:9bf8 with SMTP id y18-20020a17090322d200b0019cdd499bf8mr11419plg.28.1679435621712; Tue, 21 Mar 2023 14:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679435621; cv=none; d=google.com; s=arc-20160816; b=h0C/Is+m/9RkdnrmLmaoXOH6O9VSvFCcBkmTnBzZHKDVZ68sirz75VaZvkD1z8t+28 gmD3R83e+B3SN6GR1sDAQbTBPLmUpm71uHbQkmLYFp9iLqg+Fyc2KDkwqKhuuQ0Blq47 CbwmtZ5mLUfte+BkARKbeGh47fOJZELwplzOM/SLmiChakcK4mYRa7wMWZ++EaKe6Nrf l2qoreLpnogO/bnBwLaLbod5ooGb8Zvp6wGUflWz3bBIyEMlEdo2nKgLhe57UNXZ/0lK MU5v01Oc/VzX3QUH1aG/4cd/GuKf9G4zQ8USSzIKsZWzaAlm32EkQqJoB0SOFfD+oK4M URsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=PNp2aYWc6gs9c9BjbXPL9CK1lgmWVfhO9MsYzVCyaFU=; b=cbZGCEoYLObRzuKMJNtkFVQMv38Ph/morczHO3s9C5t3d6yapN1wY2wIqIHXZr9qy+ SgCQqKhESnf2gPGxtojmpjjStSyyYsYxzBIccUgDvFm1tESR9/EnrcyruHimHS7v/GHR N7sSwxKSMRiWHliUFrzRn02l4l3JIEPTaeHhSyPtCuE/i0sHbdJ4VuC0mFWmHXfU7sRt 0NE0jOgwfGVR/avxDsS7HsxGXvA2ydIUIsNazxoBhdTUGTxbSPHF6BpSm3SjcOYFd8os aNE7Pts9ruD2ZR8CEdQbjIqj3PgJ3NywAzwR6Q4fqC2HMaEGUiOjmuMRnd/jk8U/8qC+ a2qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c14-20020a170902d48e00b001a1ce0509c7si7290714plg.16.2023.03.21.14.53.26; Tue, 21 Mar 2023 14:53:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229945AbjCUVnX (ORCPT <rfc822;ezelljr.billy@gmail.com> + 99 others); Tue, 21 Mar 2023 17:43:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbjCUVnU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 21 Mar 2023 17:43:20 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4FCDA0 for <linux-kernel@vger.kernel.org>; Tue, 21 Mar 2023 14:43:19 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id ejlCpyJDJQ3ZFejlGp7IvP; Tue, 21 Mar 2023 22:43:18 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 21 Mar 2023 22:43:18 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: Mathias Nyman <mathias.nyman@intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr>, linux-usb@vger.kernel.org Subject: [PATCH 2/2] usb: pci-quirks: Remove a useless initialization Date: Tue, 21 Mar 2023 22:43:10 +0100 Message-Id: <a3c703152d89a2c6b34b31f0158f84ba504e24d8.1679434951.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: <3850d93ff40ed12f4724621a540fb5993c0a0fa9.1679434951.git.christophe.jaillet@wanadoo.fr> References: <3850d93ff40ed12f4724621a540fb5993c0a0fa9.1679434951.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761015886451276166?= X-GMAIL-MSGID: =?utf-8?q?1761015886451276166?= |
Series |
[1/2] usb: pci-quirks: Reduce the length of a spinlock section in usb_amd_find_chipset_info()
|
|
Commit Message
Christophe JAILLET
March 21, 2023, 9:43 p.m. UTC
'info' is memset()'ed a few lines below and is not use in the between.
There is no need to initialize one of its field to false here.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/usb/host/pci-quirks.c | 1 -
1 file changed, 1 deletion(-)
Comments
On Tue, Mar 21, 2023 at 10:43:10PM +0100, Christophe JAILLET wrote: > 'info' is memset()'ed a few lines below and is not use in the between. > > There is no need to initialize one of its field to false here. > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > --- > drivers/usb/host/pci-quirks.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c > index 6b741327d2c4..46f2412dcb40 100644 > --- a/drivers/usb/host/pci-quirks.c > +++ b/drivers/usb/host/pci-quirks.c > @@ -208,7 +208,6 @@ static void usb_amd_find_chipset_info(void) > { > unsigned long flags; > struct amd_chipset_info info; > - info.need_pll_quirk = false; Why not just change the line above it to: struct amd_chipset_info info = { }; and drop the call to memset entirely? thanks, greg k-h
Le 23/03/2023 à 17:32, Greg Kroah-Hartman a écrit : > On Tue, Mar 21, 2023 at 10:43:10PM +0100, Christophe JAILLET wrote: >> 'info' is memset()'ed a few lines below and is not use in the between. >> >> There is no need to initialize one of its field to false here. >> >> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> >> --- >> drivers/usb/host/pci-quirks.c | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c >> index 6b741327d2c4..46f2412dcb40 100644 >> --- a/drivers/usb/host/pci-quirks.c >> +++ b/drivers/usb/host/pci-quirks.c >> @@ -208,7 +208,6 @@ static void usb_amd_find_chipset_info(void) >> { >> unsigned long flags; >> struct amd_chipset_info info; >> - info.need_pll_quirk = false; > Why not just change the line above it to: > struct amd_chipset_info info = { }; > and drop the call to memset entirely? I find an explicit memset() more readable, but it's mostly a matter of taste. I'll send a v2. CJ > thanks, > > greg k-h
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index 6b741327d2c4..46f2412dcb40 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -208,7 +208,6 @@ static void usb_amd_find_chipset_info(void) { unsigned long flags; struct amd_chipset_info info; - info.need_pll_quirk = false; spin_lock_irqsave(&amd_lock, flags);