Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp43338pxb; Tue, 12 Apr 2022 16:16:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmJoLE/1bv0/X/R5XsGonZ48NptJcqBonv9XVoEKryZuwHS4rewC+6IRtkVxDfRqVfoGCt X-Received: by 2002:a17:902:ea52:b0:153:fd04:c158 with SMTP id r18-20020a170902ea5200b00153fd04c158mr39311557plg.83.1649805398359; Tue, 12 Apr 2022 16:16:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649805398; cv=none; d=google.com; s=arc-20160816; b=MVsioLnKGyKrkKNeH5teGD/wAXtuFd16c3OwsL4cywNrHNvGQK4RtRfabE6E4uSY8a mAfiwCkKsMnehfEMgIqqsg07CYyd9uP4FkkGxFj4ThYnKRfMe7MEXZzcUdvP2C8n/60/ W7G+yPTqOcH7jrO4NnjZxKbrduwntIipg5/UcvXkG1FRwXD80hrUoaqQMd39pm+gcnJR 39h+pvGoJojek+U5ITNd/SwEyByRsDJlJxpUyZuWClbTqtnUf+/Fzl4rJjO4obqCCNqf 6gJxWJtWwtuoZbjOcJfRDev009JIpgGRyIemByb9HpPx95k+FGZtaFZ6F8HFJrB88G8w Q2fw== 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 :dkim-signature; bh=JrLemglUST4WORuuuukktAwV8TRd9yLyGflAl3xl1zc=; b=tgKdkq07wJUbDC+ZNmWt5wNP6yhf7cRYue++hkP48NTykpBNFw+wXjRyhOfDo+SlGH GmACmR6H6qNtV6TOLzgCcxZmqHfEbstGG+ugaHjRFcfT2AAflPciKKksMqBa03rzOyV8 3k30//Za7LksQMSEEpVoF04wWRRgV2Uh1959OOOsEuLPnCS9yJ290ALPkNcAg1BILBHy ANcaqTiGjnVVyKX2uXfMZJWm4mUA+uESqpAnpJeRjHnquzvZduRuQe5YN69C9BpA24cT Y4r9aWDi4A8uAHDkJ5sTtp+8PEhpoDPldrb+9JkViOk/wrxMLQ9ToP8CGZg0JkYwkch6 hizg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lZrp4fUK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d19-20020aa78693000000b004fa3a8e0086si12291455pfo.317.2022.04.12.16.16.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 16:16:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lZrp4fUK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E964221B2C0; Tue, 12 Apr 2022 15:01:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353042AbiDLMua (ORCPT + 99 others); Tue, 12 Apr 2022 08:50:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355295AbiDLMsJ (ORCPT ); Tue, 12 Apr 2022 08:48:09 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE42960EF; Tue, 12 Apr 2022 05:16:39 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id lc2so16362441ejb.12; Tue, 12 Apr 2022 05:16:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JrLemglUST4WORuuuukktAwV8TRd9yLyGflAl3xl1zc=; b=lZrp4fUKHuSqiOLSJtpVC7XXMD0asm7ixPH3FzwMKxz4wTFY81n7AZNGcznRjoJDjw ImJJkIdZDpeyXwXRa72utr2cTE6/up0jKF2dieBvSDBmO+V/CDpO7jTw6zG8s+PGz0rx iJcQB6866kBoMX9E31+b/0LYLmfrDaHavCtmQXUrTG/co/r8uRUuAuZGQ1J91bxe7+Sp PqbcmXjh4Fb3JE28zM/pUTaGT4WfZjnmFizg4+0Q6K8pnYGTsqeeIS6Z3+npPCGPE0e9 vYzkjZXHzEg3hIrq3rsGGjOQTFsjbWqhY0e34zIJd8A57XqeYBM7m5LT5/nI6j5RHSNG w09Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JrLemglUST4WORuuuukktAwV8TRd9yLyGflAl3xl1zc=; b=uNIKrj22qC1kgDh+aX5fourthOIrNBI8fKUe0Sf6C4IKzUtY7tqfPhuOwh7lBW377Q TsJuy5a6G9tX/LociB06rGM0QeH5WLT2jMU9LB8ZaM8WuKkeUGbAW9ygtl2TWkqArAJL /PgHhO3A0nXB9M78Ua0EdZwfq1mbPiPiJ48z+wJ26lpFMgvqjNxjk1X0Ov5NXet/1P2S sWvsVPzOezy8E1SfExufuEUSSp6BrqHnqWLhzr67GrPamhYvmfEHIFCWSmXqF4NXF9y6 vTaiBI9Aca4KrVgYOc3K4rWHRtQ2HfR9MCGGILyxBiTQOaEKAq8rXiF7IjWzDEvZeWQA Emmw== X-Gm-Message-State: AOAM5327A66xm3BTQFTk/o7mVctbhQq3fFpcTM2nxcWVC+noiPr9yctZ E6IRbwAktmWDErD+n6EuKl4= X-Received: by 2002:a17:906:4787:b0:6e8:9252:5bef with SMTP id cw7-20020a170906478700b006e892525befmr9204660ejc.679.1649765798369; Tue, 12 Apr 2022 05:16:38 -0700 (PDT) Received: from localhost.localdomain (i130160.upc-i.chello.nl. [62.195.130.160]) by smtp.googlemail.com with ESMTPSA id b5-20020a17090630c500b006e8044fa76bsm8827900ejb.143.2022.04.12.05.16.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 05:16:38 -0700 (PDT) From: Jakob Koschel To: "David S. Miller" Cc: Jakub Kicinski , Paolo Abeni , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , Lars Povlsen , Steen Hegelund , UNGLinuxDriver@microchip.com, Ariel Elior , Manish Chopra , Edward Cree , Martin Habets , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Jiri Pirko , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Casper Andersson , Bjarni Jonasson , Jakob Koschel , Christophe JAILLET , Michael Walle , Jason Gunthorpe , Colin Ian King , Arnd Bergmann , Eric Dumazet , Di Zhu , Xu Wang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, bpf@vger.kernel.org, Mike Rapoport , "Brian Johannesmeyer" , Cristiano Giuffrida , "Bos, H.J." Subject: [PATCH net-next v3 11/18] qed: Remove usage of list iterator variable after the loop Date: Tue, 12 Apr 2022 14:15:50 +0200 Message-Id: <20220412121557.3553555-12-jakobkoschel@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220412121557.3553555-1-jakobkoschel@gmail.com> References: <20220412121557.3553555-1-jakobkoschel@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 To move the list iterator variable into the list_for_each_entry_*() macro in the future it should be avoided to use the list iterator variable after the loop body. Since "found" and "p_ent" need to be equal, "found" should be used consistently to limit the scope of "p_ent" to the list traversal in the future. Signed-off-by: Jakob Koschel --- drivers/net/ethernet/qlogic/qed/qed_spq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_spq.c b/drivers/net/ethernet/qlogic/qed/qed_spq.c index d01b9245f811..cbaa2abed660 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_spq.c +++ b/drivers/net/ethernet/qlogic/qed/qed_spq.c @@ -934,10 +934,10 @@ int qed_spq_completion(struct qed_hwfn *p_hwfn, u8 fw_return_code, union event_ring_data *p_data) { + struct qed_spq_entry *found = NULL; struct qed_spq *p_spq; - struct qed_spq_entry *p_ent = NULL; + struct qed_spq_entry *p_ent; struct qed_spq_entry *tmp; - struct qed_spq_entry *found = NULL; if (!p_hwfn) return -EINVAL; @@ -980,7 +980,7 @@ int qed_spq_completion(struct qed_hwfn *p_hwfn, DP_VERBOSE(p_hwfn, QED_MSG_SPQ, "Complete EQE [echo %04x]: func %p cookie %p)\n", le16_to_cpu(echo), - p_ent->comp_cb.function, p_ent->comp_cb.cookie); + found->comp_cb.function, found->comp_cb.cookie); if (found->comp_cb.function) found->comp_cb.function(p_hwfn, found->comp_cb.cookie, p_data, fw_return_code); -- 2.25.1