From patchwork Tue Mar 21 21:43:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 73065 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2026810wrt; Tue, 21 Mar 2023 14:49:36 -0700 (PDT) X-Google-Smtp-Source: AK7set9b+uLR+wMVuONP90B/CeAdxYKJYCP7+h6HMIdcLCXQYGW90U2agBqKji0XPvCAfNZpFxZM X-Received: by 2002:a17:90b:3805:b0:23d:3f32:1cd5 with SMTP id mq5-20020a17090b380500b0023d3f321cd5mr1177552pjb.26.1679435375914; Tue, 21 Mar 2023 14:49:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679435375; cv=none; d=google.com; s=arc-20160816; b=sOBeNgeBw9JQMnYxbJpPE4PMELPqMNNhQM2waoPy5UrNs6BukNgkRBlA5Fcqhs6pan NBWF/fjezKCDYEtQrUMlPo7sPRUY8pg0N24l55chTgbWtj5gD3U47uxN3tcESLUvtvIl iIDeE4ySGI6CbaAGxgCtxUyGcGSG/3OOSP5WiNUJKp/XmgOAjbPkMrIwgcO76MAb9Xp3 zh8EpNK5S91wblTwYCYpSe3RAJBm4oZkyhzEiCoKL/rMW9Nsxle38aHb2B60ItAI7ZmQ Q0rqPVvmLpb7ADBYbps54t0uFmlWy/WoLmmF1Jh8Wm2ABwnEIFdJXc8lP7CRmAAANg/b iNsw== 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=5WFjYppiChqLYbaEi1d7oP1PimLJ2cIB0O8KTJUDEwE=; b=DLEIi4sjBa7K7LrYyilyxdvX393+xmb+ExJSOW0MJlNKtM6+67yibymB6/gxgYINW0 yBgHuTyGG7mfMNeOd7SIWxVO6HzEaU62It5Trx3s7TV5E9pxXIgtexi+km7B6+MJo7ei rWa88Bt/DQxV0QV7KmSK2+p7F4KTMewHBj1uWBAi388RG+dCh0jeMsoebtf2VPOhHsHW 2ldW1VyuuVrRaivtcKcbjiTHBmyW6mmu6H3K28OLVYYjHqJk1Ia+iJ/QAsVlcTmazvBC njoCO/oX5+GomI8aanCT2kSzPGTc8DRsqX0866aRwEwguMFJxhDDxYtcR/jUoKkd50Ce IgBQ== 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 h14-20020a17090adb8e00b0023def94be5esi14003314pjv.20.2023.03.21.14.49.22; Tue, 21 Mar 2023 14:49:35 -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 S229892AbjCUVnV (ORCPT + 99 others); Tue, 21 Mar 2023 17:43:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229838AbjCUVnT (ORCPT ); Tue, 21 Mar 2023 17:43:19 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11F449EC7 for ; Tue, 21 Mar 2023 14:43:17 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id ejlCpyJDJQ3ZFejlDp7IvB; Tue, 21 Mar 2023 22:43:15 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 21 Mar 2023 22:43:15 +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 1/2] usb: pci-quirks: Reduce the length of a spinlock section in usb_amd_find_chipset_info() Date: Tue, 21 Mar 2023 22:43:09 +0100 Message-Id: <3850d93ff40ed12f4724621a540fb5993c0a0fa9.1679434951.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_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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761015628915316642?= X-GMAIL-MSGID: =?utf-8?q?1761015628915316642?= 'info' is local to the function. There is no need to zeroing it within a spin_lock section. Move the memset() after spin_unlock_irqrestore(). Signed-off-by: Christophe JAILLET --- drivers/usb/host/pci-quirks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index ef08d68b9714..6b741327d2c4 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -218,9 +218,9 @@ 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); + memset(&info, 0, sizeof(info)); if (!amd_chipset_sb_type_init(&info)) { goto commit; }