From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 020DDC433F5 for ; Sat, 26 Mar 2022 07:25:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231821AbiCZH1O (ORCPT ); Sat, 26 Mar 2022 03:27:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229499AbiCZH1M (ORCPT ); Sat, 26 Mar 2022 03:27:12 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD2E2DD8 for ; Sat, 26 Mar 2022 00:25:35 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 22Q7PLXa017135; Sat, 26 Mar 2022 02:25:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1648279521; bh=Hv7YXBe/2Y0lpaGXGu39vfIikytNrKb6clLyKYiPggU=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=tLFm8MjbdrQDDUzjlnMHvoS+Azkt1QBJcjYrv2pVqa//9QjEKRWlayS4KoHCikB7I JZCvr0nZO4prSu9xORsevEDlOGpaUySCTy8SBnzz2G3dMIFbl1SqKnaVIo2IP8t+vt f0Ne2omzh1YqnTHfKoeVsjGDZoCRp7pZbPRFYGe4= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 22Q7PLTA001882 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 26 Mar 2022 02:25:21 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Sat, 26 Mar 2022 02:25:21 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Sat, 26 Mar 2022 02:25:20 -0500 Received: from [10.250.235.115] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 22Q7PHMk018492; Sat, 26 Mar 2022 02:25:18 -0500 Message-ID: <7f160e8f-f3a3-33ff-3471-72978d0b34bc@ti.com> Date: Sat, 26 Mar 2022 12:55:17 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] soc: ti: replace usage of found with dedicated list iterator variable Content-Language: en-US To: Jakob Koschel , Nishanth Menon CC: Santosh Shilimkar , , , Mike Rapoport , Brian Johannesmeyer , Cristiano Giuffrida , "Bos, H.J." References: <20220324072503.63244-1-jakobkoschel@gmail.com> From: Vignesh Raghavendra In-Reply-To: <20220324072503.63244-1-jakobkoschel@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/03/22 12:55 pm, 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. > > Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ > Signed-off-by: Jakob Koschel > --- Reviewed-by: Vignesh Raghavendra [...] Regards Vignesh