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 87632C433F5 for ; Mon, 4 Apr 2022 09:36:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343889AbiDDJiU (ORCPT ); Mon, 4 Apr 2022 05:38:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355515AbiDDJiO (ORCPT ); Mon, 4 Apr 2022 05:38:14 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24D6730542; Mon, 4 Apr 2022 02:36:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649064979; x=1680600979; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=z66BBs6gd1wX1NuShMNR221afgtnYZTW8DgJ5qOqV3Y=; b=eT2H/knZ5YlHmkJk+RzuJgnTRWX2TyaouWHm49QnsSONrCnPSHL+XXAn 6+8oaezJ81FhVrvhuKGn3Mo3ldy5QZKtL0aEa2mHAueoWyByqjYjoaEGg lVR6TR9LEqTQpCYe/rDYKssj0yYTjW0lfWIvdaRzwtGeqpmb5fcAR8OHA LZZ08SO400FjgOULaH+uc90nnU9vl2+Ad9h9kSsn/7ripy2FGAlP2d+IN c0A/KCuQwTeLjtUODdwJpPKIui0nMiVXXPSpI8aQnX7mn1rLPQ03PHL7/ T2f/SmCv8k9anbYwcJ1v41vJ0eST1/GFjO6TY0FE/PSNbReSXpaio4ptY g==; X-IronPort-AV: E=McAfee;i="6200,9189,10306"; a="247988806" X-IronPort-AV: E=Sophos;i="5.90,234,1643702400"; d="scan'208";a="247988806" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2022 02:36:18 -0700 X-IronPort-AV: E=Sophos;i="5.90,234,1643702400"; d="scan'208";a="504845794" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.162]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2022 02:36:15 -0700 Received: by lahna (sSMTP sendmail emulation); Mon, 04 Apr 2022 12:36:12 +0300 Date: Mon, 4 Apr 2022 12:36:12 +0300 From: Mika Westerberg To: Jakob Koschel Cc: Andreas Noever , Michael Jamet , Yehezkel Bernat , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Rapoport , Brian Johannesmeyer , Cristiano Giuffrida , "Bos, H.J." Subject: Re: [PATCH] thunderbolt: replace usage of found with dedicated list iterator variable Message-ID: References: <20220324072700.63787-1-jakobkoschel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220324072700.63787-1-jakobkoschel@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Thu, Mar 24, 2022 at 08:27:00AM +0100, 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 Applied to thunderbolt.git/next, thanks!