Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5565420pxb; Mon, 28 Mar 2022 14:18:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXxNFoNZQ28Atyo3SkUGCjapxPzg8+zrkTQzO9EgUFSsWYXgojY5Iq2f8svM5VbMLcegX8 X-Received: by 2002:a17:90b:2308:b0:1c6:96f9:8d0 with SMTP id mt8-20020a17090b230800b001c696f908d0mr1051461pjb.127.1648502285742; Mon, 28 Mar 2022 14:18:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648502285; cv=none; d=google.com; s=arc-20160816; b=d4CHs2szhQ+e5GrpA+CxLYmXTpo7NJRnybSE/GgGR5req17Kk9fzqiEXbjQLDqg/dw U42cUH2ZKUJ6jjea9U/FC65NKF7R+cNys5gPP0GghDqkegwwcjB3KF0NskryYk+r+6tE 0US2KFQQFCQgWmthXtmHZqIgHrupUKJmL1G261/0dpQTRxMWe48/LwUhr+CBo4/3xNpy DDuLFyQfS7ussZKDsFNzLihRwbXEjXB6ET7I7xSZkCTSOPC3WIOakH4bJVBPKolkZv/s mBrBM0B1PV+Ymmay5RWnBsjgINm8mo8ynsdirfmtaTv2+NZrsW5K2uE4geVW2KJ6KpO1 sZnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=V9wG35sSYoELLextVQIkA8Cn5S33+Gei8B7JRG6UIvs=; b=dIRMUFvFTQOvSg6b96L2VtD7C+5l5U+9v4Z+1Fppqh2iQRd0qR4/x8zFFhJJ+ZcbsV gtxhRnTghXF91f+AuVb2L+qMkenl1uYITMRlGqEhfDbUBmjfWZ8sTBSrC134M3RUjbdv x5iCDTtzfkIDKU5Ivdw8O0ArjCY9Y3fJTsHkTJpJdsVLQc1xcy+wHuNNJDWggzNKy6HU A+liI9ZpH5LJgzMS4lv9tdM75B9WXUzn94Qx3zXNw75Urorc8P2yVLoHSs2lvN82Rddp 8TON9S9Vwq6siAhAMDtIYhimL98H6ohcpv3fiXBmHLXhR9OO+SCTv6qtU4QuDy0hvwjl T7Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XdoT7pYg; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y4-20020a17090a390400b001bd14e01fcdsi548339pjb.187.2022.03.28.14.18.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 14:18:05 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XdoT7pYg; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2E8137D010; Mon, 28 Mar 2022 14:07:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238444AbiC1G3I (ORCPT + 99 others); Mon, 28 Mar 2022 02:29:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238472AbiC1G3F (ORCPT ); Mon, 28 Mar 2022 02:29:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3575F522D7; Sun, 27 Mar 2022 23:27:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C8C82B80E46; Mon, 28 Mar 2022 06:27:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18DF4C340F0; Mon, 28 Mar 2022 06:27:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648448842; bh=meJvJUNXmP1B0s8GQqdqGBbvf3SOKnU0JOh94zcvqJo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XdoT7pYguHNOLiSLxOctmCCd+2U3kLC328sI7xclFwpRytuAKHZP8etMkLXJjb1Os UdxkS9VYtJ611sIkQCf17Y+7IE0FPBaMwfKHIdIURco1dJGIe5PqcIPfyRpzdTaqkj dkU6BUIRJ5tx54NrchBQH/gomILpCUW7js6Ee/i71EjHcXW5RUtPJ2dHvCjJksXfBr 2iM0BlV5NriRB7pOB4LETbiZg+6jtChcFVF5Jc2bYhM1ZSpMrmi1rMLNJ5uVJIGnhJ KZamH9un6jZ+vBD7Pw6uyWRtlimnZGqqZ8f9iOGVkIA6YbReeVCqLGy+23VrhhivoG +k1Qcpjih45cQ== Date: Mon, 28 Mar 2022 09:27:18 +0300 From: Leon Romanovsky To: Jakob Koschel Cc: Jason Gunthorpe , =?iso-8859-1?Q?H=E5kon?= Bugge , Mark Zhang , Mark Bloch , Christophe JAILLET , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Rapoport , Brian Johannesmeyer , Cristiano Giuffrida , "Bos, H.J." Subject: Re: [PATCH v2] IB/SA: replace usage of found with dedicated list iterator variable Message-ID: References: <20220327212943.2165728-1-jakobkoschel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220327212943.2165728-1-jakobkoschel@gmail.com> X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 On Sun, Mar 27, 2022 at 11:29:43PM +0200, Jakob Koschel wrote: > 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. > > To *never* use the list iterator variable after the loop it was > concluded to use a separate iterator variable instead of a > found boolean [1]. > > This removes the need to use a found variable and simply checking if > the variable was set, can determine if the break/goto was hit. > > v1->v2: > - set query correctly (Mark Zhang) > > Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ > Signed-off-by: Jakob Koschel > --- Please put changelog and Link after "---" section, as we don't need it in git commit history. > drivers/infiniband/core/sa_query.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) The change itself is LGTM. Thanks, Reviewed-by: Leon Romanovsky