Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp55783lfv; Tue, 12 Apr 2022 17:05:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkW4aEFUMkm5fKMdWiQ9J2OQ4pjkCNWEqhLqav9n7uSgKcGBlFmF71j3SxwAnJbh9MLySo X-Received: by 2002:a17:903:120c:b0:154:c135:60d3 with SMTP id l12-20020a170903120c00b00154c13560d3mr39770206plh.48.1649808354213; Tue, 12 Apr 2022 17:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649808354; cv=none; d=google.com; s=arc-20160816; b=rIRYnbve0eLZ1946i5+gFAb3jvG1cY5Rjfxz3oJzfQl/rbtS67+94y0d8IWxQ1fdJr gTjGPa4b+7ItoZ32q8J9mGw70jFypH+sxlbPYrWaDsI741arApUO1aWWUrCy9dXMEbjK hyUxj2WLWnjHMnSK7LibYUqsDI3g1xtkaGU396dxqPYUKluUsETtRgAAevLRXLNOEUfb m0N13mYUhEjvMQZxcv/nJIKU0hx8bDM1Jn+XYr7qYKbRijyVzUz6kznxllW3JwKXdBWz 859f64AHYFpo4RImsifUZ5+CsZjJ1Bgm7WJw2K1mj2dWb8pZ9wVy70NXZ30SFexgAMct gEuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=4AvCQRCXDK6lkDTDdFdrHfouCU5/V3sgvOz5YOMR45o=; b=mfpvJWqT/ufukj5ZVtNy3toEobNYO95yQQMkXqQuSh5pLbD1sZjC+TOcDAK+g3Sg09 fqkuDuCqSgtDbl04Eqw1dKs028OvQk0+OBx3lgP+GeWfZctwEkXLUWXv9vumYHvppTOB JL2/qpCVpSm1LurLxQ4rXtQwyhsnae4knwLIC84tRVPSXDFuF3gJo/B1N6uGH/8k90jw c58OjyViRKxTMwLoU+zKhfAZblngf/QoNOAnfkjKz+np8lyhlCFlLnOZkVV1GBSK77TM RY8VG3x2JY0nnjjL8ZVcroWnKShO3K1bbIRk5QY8h1jIl/iqwWxxuxJERf9FQ11smnd6 hYzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=GBGjuOQv; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i16-20020a170902cf1000b00153b2d16422si12957117plg.42.2022.04.12.17.05.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 17:05:54 -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=@gmx.net header.s=badeba3b8450 header.b=GBGjuOQv; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5862321F770; Tue, 12 Apr 2022 15:03:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230072AbiDLUkE (ORCPT + 99 others); Tue, 12 Apr 2022 16:40:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230181AbiDLUjw (ORCPT ); Tue, 12 Apr 2022 16:39:52 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E799778921; Tue, 12 Apr 2022 13:35:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1649795549; bh=IrspqYP8ymy9ueHzSGHCQmZBice+jhJrZO+S5bPpMWk=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=GBGjuOQvVglx1k+KBeiBiGY/1jHQqh3P1CmDsSga+SvcxhTvOnCIF33w4uL8EjkF5 eE/I4/B2ka+7X5AMMBNt+Sd7cpf/MdU47xLt/6uwiz+f89whBAj6iY6Y7QhFqL/OA6 +1LQma0vp7WIY3gomFwn/jMO14qApD9FDmbEPLlU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.20.60] ([92.116.135.215]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M5fMe-1ncglq2Hak-007B7f; Tue, 12 Apr 2022 22:07:00 +0200 Message-ID: Date: Tue, 12 Apr 2022 22:06:59 +0200 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] video: fbdev-MMP: replace usage of found with dedicated list iterator variable Content-Language: en-US To: Jakob Koschel Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Mike Rapoport , Brian Johannesmeyer , Cristiano Giuffrida , "Bos, H.J." References: <20220331223503.902142-1-jakobkoschel@gmail.com> From: Helge Deller In-Reply-To: <20220331223503.902142-1-jakobkoschel@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:v3JE1ZICfMfPrsfvy8/eg3kgYv0qoPZEH4uA47/8+QfPmHfZC8F wuCWQdxmVwbOna7Nhk3SfJlsWB4Hrx7jlmLOstCstC04FFW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/R+ktxCniUgh/ruAgdSZOdkbasXw4bp5Jlz46nEiPqU6fGkueqzk36k6ndXjidJK C3BmPtoHMc/X3o5lZrQk58dKuWbas600o3TjsUr21b9BDrcNGiekUZ/vzGjbRw/IUNysyRzwA PlNqk7HXOEKumV2ifOpwYaO+xIAO5xPvRXTTPVTOqTLqe/6veoNax9aSFkQKVdpJ229dKnNfQ md6ekKGn5pbbpk= X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, 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 4/1/22 00:35, 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-=3DwgRr_D8CB-D9Kg-c=3DEHreAsk5SqX= Pwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] > Signed-off-by: Jakob Koschel applied. Thanks! Helge > --- > drivers/video/fbdev/mmp/core.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/drivers/video/fbdev/mmp/core.c b/drivers/video/fbdev/mmp/co= re.c > index 154127256a2c..03707461eced 100644 > --- a/drivers/video/fbdev/mmp/core.c > +++ b/drivers/video/fbdev/mmp/core.c > @@ -127,19 +127,18 @@ EXPORT_SYMBOL_GPL(mmp_unregister_panel); > */ > struct mmp_path *mmp_get_path(const char *name) > { > - struct mmp_path *path; > - int found =3D 0; > + struct mmp_path *path =3D NULL, *iter; > > mutex_lock(&disp_lock); > - list_for_each_entry(path, &path_list, node) { > - if (!strcmp(name, path->name)) { > - found =3D 1; > + list_for_each_entry(iter, &path_list, node) { > + if (!strcmp(name, iter->name)) { > + path =3D iter; > break; > } > } > mutex_unlock(&disp_lock); > > - return found ? path : NULL; > + return path; > } > EXPORT_SYMBOL_GPL(mmp_get_path); > > > base-commit: f82da161ea75dc4db21b2499e4b1facd36dab275