Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3367432pxp; Tue, 8 Mar 2022 12:50:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzg2dpa9rv2aUdroV/AW+hHan78yG8P3qAm34z9eDq0iPJd+msuTX0aCbezgmSDrtLS21X X-Received: by 2002:a63:874a:0:b0:37c:7fab:50fe with SMTP id i71-20020a63874a000000b0037c7fab50femr15477520pge.93.1646772657301; Tue, 08 Mar 2022 12:50:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646772657; cv=none; d=google.com; s=arc-20160816; b=L5eGrRTUMD25J8NPbaFiboUI2hPBJSgc1bvUf+6EOXvPZQVxxZ0f7vLTfvybLX00aV BG/Nvs9ayA3AN1xIFYe32roFnIww8JTco34aurdEbYYIErtel08/ekITIoP55c0TmXTN UT8nC2j2G2C7mVY2yIK4y9w3k1InZ2hndduh25Ky09lNfVvoEc3Y8QXMhl8tvWcfP2ya tzqCqF/p3t+c9D+TGQl8DmmQZicD8hTd6hYwVGSHLFp7nFM1NdyTyeQrArxy1N0npILi TWRuH1wkmbV0oVBEFFRevZCfxwQGWkfHQpfF6IPiHBH4sSuUe9y+w/tPTGSeNoHE8BaA yBdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=kCqiZMDOoxVmsCzewcxRsHgf4JgZ2ErQFYoCGtF72sg=; b=NW3o0Shn5mSPb0008lhxD4EVdsQvrrzTI8dwZEnXpK1Gi7vQuU8vyH1jOb7TeLQ47N 0QALxRGfZo350sMvNnoq5lIkKUOJD2kPas0maOBuk2qyApU6HW6zuibpSP9mKgBE118Y n7R9KL/ch2+yk+9r0V0hJ5p5Em3S+yLvCA6yipk8A4g9Kgcg2wWZoikuPkN/oi6aziyA r5qQW7qdvjtczoys2NvLFIZAboe+wsRMLXuX/S/YaNAYYPj0UNvoUjeyI9H3JFGQRum6 NtBqhG2J2km82wYtKG07jzdrx4lECHrdmM+iqbRLYQx+JzsnKgVRihhxbqyU71K9Sbt0 j/bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hLLztc9l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 136-20020a63028e000000b0038077f647a2si5512243pgc.493.2022.03.08.12.50.41; Tue, 08 Mar 2022 12:50:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hLLztc9l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240467AbiCGKSu (ORCPT + 99 others); Mon, 7 Mar 2022 05:18:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240517AbiCGKBE (ORCPT ); Mon, 7 Mar 2022 05:01:04 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A631E2559D for ; Mon, 7 Mar 2022 01:49:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646646591; x=1678182591; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=zuM8kRheDPx8x/ZAANh8fV7Si9//wAZ0JIyjesygWcA=; b=hLLztc9lh4ezVr3zE5RQwkkMnX85Mgos3A/COIt4sjj4ITZ25tztUDSb fq2Y3TPM1AKQ5dgMbshUfJdW1YM1y3NrorbFVe129CzSuA1udkvJpRRtS qHSc9QRKb0YK5CkCsh+W6mN4eYE4bL2xgYhjvS17jODXkzy5b+ivRSb1E F5VO0UvZsi/Ivp3iJs5ZcMM7gG41/oALgfHhvppCtyCZnk0nhC9eChIA2 47ANEhm391ZNITDzuBv/XsS937gr7w8wCzN7yYtA2QMZglEQXmkEdJzd8 3BDdU2nhcE8RDhppBT5yLJfngYtIgQDHcXWnrctWnaMPNeQbAqqceeDAV Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10278"; a="254542061" X-IronPort-AV: E=Sophos;i="5.90,161,1643702400"; d="scan'208";a="254542061" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 01:49:51 -0800 X-IronPort-AV: E=Sophos;i="5.90,161,1643702400"; d="scan'208";a="512620311" Received: from smile.fi.intel.com ([10.237.72.59]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 01:49:48 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nR9zE-00Ch8F-0q; Mon, 07 Mar 2022 11:49:04 +0200 Date: Mon, 7 Mar 2022 11:49:03 +0200 From: Andy Shevchenko To: Jakob Koschel Cc: Linus Torvalds , linux-kernel@vger.kernel.org, Andrew Morton , Greg Kroah-Hartman , Mike Rapoport , Brian Johannesmeyer , Cristiano Giuffrida , "Bos, H.J." Subject: Re: [PATCH] list: always set pos in list_prepare_entry() Message-ID: References: <20220306162635.2930407-1-jakobkoschel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220306162635.2930407-1-jakobkoschel@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 06, 2022 at 05:26:35PM +0100, Jakob Koschel wrote: > In order to assign the result from list_prepare_entry() to another > variable, it should also be set when pos != NULL. > > This will be useful once the list iterator is no longer used after > the loop. ... > #define list_prepare_entry(pos, head, member) \ > - ((pos) ? : list_entry(head, typeof(*pos), member)) > + ((pos) ? pos : list_entry(head, typeof(*pos), member)) I'm not sure why then we have () surrounding first pos. Am I right that the original is an equivalent to ((pos) ? (pos) : list_entry(head, typeof(*pos), member)) ? Then what the difference is made by not using parentheses? -- With Best Regards, Andy Shevchenko