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; } From patchwork Tue Mar 21 21:43:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 73066 Return-Path: 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 + 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 ); 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 ; 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 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 2/2] usb: pci-quirks: Remove a useless initialization Date: Tue, 21 Mar 2023 22:43:10 +0100 Message-Id: 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 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?1761015886451276166?= X-GMAIL-MSGID: =?utf-8?q?1761015886451276166?= '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 --- 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; spin_lock_irqsave(&amd_lock, flags);