Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp55158pxh; Thu, 7 Apr 2022 13:48:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdqDuBS9LxQAgr2jMEP1STIl9Y4eSvPJ53eaZZ0KOOlkt5cO7vppRD9a5TV+lyHRCIOQEx X-Received: by 2002:a05:6a00:4293:b0:4fa:e005:7e99 with SMTP id bx19-20020a056a00429300b004fae0057e99mr16029366pfb.20.1649364520281; Thu, 07 Apr 2022 13:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649364520; cv=none; d=google.com; s=arc-20160816; b=Wf0yPnELUtgFGCVxJpXEDLlVvvfZyLzegIl8ficU8Od7v7ze0NhNCSK7lLGXHu89EC I/W+Ij7YOoINuqXOClYAd9SvaTaN1XrID7EvqmFhQhSrIcYnWiXyTZOBIZYuEHzI78PO 1ozZVTmexEgGfqTGX53I8zJccSxmM88SP08yN3emYE6dk/KgkGrMU/PB8FhMw+toV1gl jh6fW4+JC7BYTn8sZGItUGyBbfQlWD6wpGfleGs01EBg25FYrKKQRCaNX67PfdVEBLsU NbqU2UwHL2mGoOsWzmfT3EcGkDTnncVxZ5gCOG3jZ1Hgr3C2JvTxBdvFuptQ/p9MM8Rp /Pbg== 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=a5WIK5wHkF9P5wuSDSw+DYEwiwIw87nxA88r2Fu95HM1s1oeUBaj5gg/tir1QluIjJ brzQ+RxJLvDqwstbCwXRm8sGEwaNn/tyMxw8hzrLia5qDImKNLnp4Xw1LBxAZaEP+gc/ j2kIIDTmI67SOKgZ7F9MMq1pMB/eSmqiGa8XRDJMtaHPIEBvY0vOjxf1nTkX/MFrG2oG JTnYfWF0FOwed8OpPSLsKbZ3pEBLOODbfTG3JdUxEwgs0Xkl618Car6ymCD60xzJLOJn auxI8QsQ2pw+fMzz1p9Hf4FyQbb10kayKM1PtTNZZjs9n5H4uyDZF29zdQbQng6Q3IEo Nl+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WyOREzFf; 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 z9-20020aa78889000000b004fa895878afsi20673987pfe.254.2022.04.07.13.48.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:48:40 -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=WyOREzFf; 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 978543DBC88; Thu, 7 Apr 2022 12:55:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239781AbiDGKd5 (ORCPT + 99 others); Thu, 7 Apr 2022 06:33:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244306AbiDGKdf (ORCPT ); Thu, 7 Apr 2022 06:33:35 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FDFD9683B; Thu, 7 Apr 2022 03:31:12 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id dr20so9836184ejc.6; Thu, 07 Apr 2022 03:31:12 -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=WyOREzFfzYbYbcLeB8gc+wwbWojyzKQUgWjvo9Vn4QjrT1rTi9xtZRj0mVTe0B62ty JXFIP3trzcbd5i4YgUkTx/ltYxiagR4lJ0OPxM8UZ70oCHJ3U4M1q+1xgHFrD4bt5BJu TiKC7QXqW1sLc9HcMLxVP8ka1LRg94eK2McleovX+8TrXVbFOYUeSQzlauxOhKRfjWJY SixUHMJIRmnVW8P6LuIOSHzRLMIs+tg9L7Uhkoxg7cmhWDV8O0CSoOfNs+uej8UgHtCJ chVqhJAWIKvd/EeXFL4roipes4cs7ySm//Jj4r0+/WkZNwrPvwjJG4Uu0Wmn0GRG5ang ZOaQ== 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=nixL/rp3sXAAHunD2MsYG97KCxjpZzK8M1t/SZfZjsYfKL8Fe6vJHp3tPTFwoOwaSh JJcJBU6euaFszWbcB3tHb5dayIBnZB6Ot40wfh1VTevRWw1HCrEj8RMCb3hH8A5uT09B YihmG12Io0v3kLn6VVHAIVUJEsxwf3REiRgPnzFCvKkxxdTf1C5aO9EjTvoSvlfjMclx Y0Jpj4cF7cWfPmxALevfUQsidGNCAXZja5RHOos8MX+PpoAifPKajQYG0NS52tqfoB7V eicU4l1BlY1U9ZbNfW+cRBfANODdbBTyD4514Yz6s+9hx3zwj54laIdAm7rDJXiqPWuJ BK5A== X-Gm-Message-State: AOAM533EXScrhopYlpd9ohKhREjvTF/OhgAvNgE7WVDPFZuCRscpRhXV QsENrQskbdbb6HGK56nNeGU= X-Received: by 2002:a17:906:6a81:b0:6da:d7e5:4fa with SMTP id p1-20020a1709066a8100b006dad7e504famr12975794ejr.223.1649327471064; Thu, 07 Apr 2022 03:31:11 -0700 (PDT) Received: from localhost.localdomain (i130160.upc-i.chello.nl. [62.195.130.160]) by smtp.googlemail.com with ESMTPSA id c5-20020a170906d18500b006ce371f09d4sm7413573ejz.57.2022.04.07.03.31.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 03:31:10 -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 , Casper Andersson , Bjarni Jonasson , Jakob Koschel , Colin Ian King , Michael Walle , Christophe JAILLET , 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, Mike Rapoport , "Brian Johannesmeyer" , Cristiano Giuffrida , "Bos, H.J." Subject: [PATCH net-next 08/15] qed: Remove usage of list iterator variable after the loop Date: Thu, 7 Apr 2022 12:28:53 +0200 Message-Id: <20220407102900.3086255-9-jakobkoschel@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220407102900.3086255-1-jakobkoschel@gmail.com> References: <20220407102900.3086255-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