From patchwork Thu Mar 23 19:40:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 74204 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp3116611wrt; Thu, 23 Mar 2023 13:23:23 -0700 (PDT) X-Google-Smtp-Source: AKy350ZEDHNz6Yv1ZoFxRzNarnvijBnAUW8IKytTKhm3AcsDoZe+Qdff6zgOmM/qpHmVuUhrjs7o X-Received: by 2002:a17:907:7e8e:b0:933:4647:a289 with SMTP id qb14-20020a1709077e8e00b009334647a289mr426664ejc.48.1679603002952; Thu, 23 Mar 2023 13:23:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679603002; cv=none; d=google.com; s=arc-20160816; b=Uw2x+rVNOsUz4ddcfriugibP7mm478jx1D0eJQGZN/dl5v5PEfYDs0cq7MWDSFAXV9 GxkyK2YQZYgxPXjypyiXYFvB+HLc3wRdE9TkmcsElEyE4oNfMyNO9+7ETBQekNUc9TLa WKvT5+kY/X0cFv2JNEFlQSu4lvLQCrpocdq+lOdw/SprcmQHsieS4Ow5/eIGpQwGnt1a 3SEsxil4IRXCiqWvBjMfipw6rz38/cXbrHCTuSVGmkKB1xm3YvfMjTOnMLNc3BokDFji jHlQvW/OnOXCXf4sQErIfmelq0cU4gCJ3oHVO1pCmCnMHuDXBOldAMkGvA7+L4dV8zDC 9BpA== 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 :message-id:date:subject:cc:to:from; bh=l0/i/v9pbf57Cw/J9wArd8eNlIsYNxUzlkzoSApP1gY=; b=DVLZtPylWIlTQ2JnW8ItZY6+O5ZldsEt40XYZu9HK2h/dcSTvCMKwA2Z6IHkf9rsKw XiCEi/SPxeyyiRvl4lK4mvFT5Ij0qMTe+rIN6c1pqcG9w11BIVUykOtwJdDdjHBS4Fkn haIvY/VS3+U+8/5NH1XIrleFFAL+uRjzSryQmfHfJkjuYNegaWmsDopLhlmvfG/D6Jcp j5yBZLooAhrYo1iYsb/E6NAUmr3ket/rOGmCfzseMe6zYg6EeO293tp+4Ldj3xtujbJM SPBK2A5LhJ/TSsA8v4KVZB9Rvv7AjEJAtY17ZEo+XxstjaRexnLJMw9iXWEagjw/fklO mJwA== 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 jz12-20020a17090775ec00b0092fd27697ecsi17384391ejc.908.2023.03.23.13.22.59; Thu, 23 Mar 2023 13:23:22 -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 S231722AbjCWTkf (ORCPT + 99 others); Thu, 23 Mar 2023 15:40:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231418AbjCWTk2 (ORCPT ); Thu, 23 Mar 2023 15:40:28 -0400 Received: from smtp.smtpout.orange.fr (smtp-18.smtpout.orange.fr [80.12.242.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 185C42068E for ; Thu, 23 Mar 2023 12:40:27 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id fQnPptlrMzvWyfQnPpVPOc; Thu, 23 Mar 2023 20:40:25 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 23 Mar 2023 20:40:25 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Mathias Nyman , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-usb@vger.kernel.org Subject: [PATCH v2] usb: pci-quirks: Reduce the length of a spinlock section in usb_amd_find_chipset_info() Date: Thu, 23 Mar 2023 20:40:22 +0100 Message-Id: <08ee42fced6af6bd56892cd14f2464380ab071fa.1679600396.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761191398465079879?= X-GMAIL-MSGID: =?utf-8?q?1761191398465079879?= 'info' is local to the function. There is no need to zeroing it within a spin_lock section. Moreover, there is no need to explicitly initialize the .need_pll_quirk field. Initialize the structure when defined and remove the now useless memset(). Signed-off-by: Christophe JAILLET --- drivers/usb/host/pci-quirks.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index ef08d68b9714..2665832f9add 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -207,8 +207,7 @@ EXPORT_SYMBOL_GPL(sb800_prefetch); static void usb_amd_find_chipset_info(void) { unsigned long flags; - struct amd_chipset_info info; - info.need_pll_quirk = false; + struct amd_chipset_info info = { }; spin_lock_irqsave(&amd_lock, flags); @@ -218,7 +217,6 @@ static void usb_amd_find_chipset_info(void) spin_unlock_irqrestore(&amd_lock, flags); return; } - memset(&info, 0, sizeof(info)); spin_unlock_irqrestore(&amd_lock, flags); if (!amd_chipset_sb_type_init(&info)) {