Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5807571pxb; Mon, 14 Feb 2022 08:05:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwpAqW8PFjThCMPNCZzpHyUR8NQpqvPC+BKtuund/J+BPPZ1gbtUZZm2yrowo+eYcgaI31L X-Received: by 2002:a63:216:: with SMTP id 22mr343127pgc.89.1644854706388; Mon, 14 Feb 2022 08:05:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644854706; cv=none; d=google.com; s=arc-20160816; b=mvF9oFGvVjBW32RzKmFJ2Yh4Orf4H2vIVegqyehcygiTU+VhQiNtenK5jeHkJOpnHO R+VvxCjuqlTjCOw0KUUA+jfV1r6ALvPhielzHdjSPyyEZssJ+S94DxbB2X9fe4CI2KTj /KfsBHUetGh4WEY721sOFrbQfAbofFR4KqX3BS7RP/7kFrYHXptfxDCTSn3TIU6ED0BX wUjAK47/p3SAAb4BovHyOTwLpRKTZzbPX52rzVMj4I3VqzjeHfVMC9v8zT38GXOj8oZE T8gjWLbdkc8cyEjirsClT0VtVRvVfQmDPBPnYZ23ZBHMYL2j7+HXL0YWPYBQ0MyntZ6B ApBw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=CkjXZujIWk9NzqY4k/m99dkIFFcSQua1tJ6vxiK8A74=; b=aH9SGRvUnI5jGk8Adbam/1xZrcFWgVMZ0jQ0y5e2bbmRY42nwdOhRwD6WYMH/NOVAz wEOJ/GAVUKrdpPkOSJKqJU/LQurSfjd3Fy2ZMX70/Hz7RZCFDFDOT5L+Qq70x/glbGpb srmlEkiuBZNGfDQmS6jSVC5cx4rvJtu3CSu8iYGFbgFxt/7GtVd0iZGyWw6SOIOoH8jG XA11qiQDa9iBbGQ7No0w5X9um49seDOyc8k5eZrC86Bi06fbHhaSyZb0JENmorl5teB7 Z1BnF39q55yixRfl/RIc04GM4UQ5FH4edSGORzdciIkuOCHKg0GC1pgx2/ueZrxZi3ks ufmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JdsTl3r9; 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 a4si6527934plh.64.2022.02.14.08.04.44; Mon, 14 Feb 2022 08:05:06 -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=JdsTl3r9; 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 S1353614AbiBNMrU (ORCPT + 99 others); Mon, 14 Feb 2022 07:47:20 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353579AbiBNMrQ (ORCPT ); Mon, 14 Feb 2022 07:47:16 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F38F63A5; Mon, 14 Feb 2022 04:47:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644842829; x=1676378829; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=llcPkF1Wcl+sUIHhvXcZinKVWQQ0pJwysOxKsaAofOo=; b=JdsTl3r95eHFa421GLIb7JbDp8f5vgw29MRTVtLsbbpO7fkktVeJk1Yw /pxx2JhfWduwUTto7jKj0crv3O6Avpfw3v/VnEYQyuZNShuPEh8JpPx9Z NbkLRgdyVzMB0thW+cgf+LU94kwkOZKkizV7tn6ja6cgeAY1+Cr/qjnFX dOq0rzA42qIWr5lSZc/lwZTIOtPHBvcnZM02i8ozaWRe0r70lnW4f7tsb sZ09oWoKpsbNyHEnyqYzv5S4mxjQCYtP3tPn8m2jaQre2tfjHOW9bKIMQ BIn3vRbm8J0xXk5eHWQnvZnC0bTbTwLLC2BPLA6p7sxeSTmaxtCL6Dtyo Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10257"; a="250028598" X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="250028598" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2022 04:47:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="680470945" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.151]) by fmsmga001.fm.intel.com with SMTP; 14 Feb 2022 04:47:04 -0800 Received: by stinkbox (sSMTP sendmail emulation); Mon, 14 Feb 2022 14:47:03 +0200 Date: Mon, 14 Feb 2022 14:47:03 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Thomas Zimmermann Cc: Andy Shevchenko , linux-fbdev@vger.kernel.org, David Airlie , Daniel Vetter , Javier Martinez Canillas , linux-kernel@vger.kernel.org, Noralf =?iso-8859-1?Q?Tr=F8nnes?= , Geert Uytterhoeven , dri-devel@lists.freedesktop.org, Sam Ravnborg , Maxime Ripard Subject: Re: [PATCH v4 1/6] drm/format-helper: Add drm_fb_xrgb8888_to_gray8_line() Message-ID: References: <20220211091927.2988283-2-javierm@redhat.com> <4fa465d9-4fac-4199-9a04-d8e09d164308@redhat.com> <7560cd10-0a7c-3fda-da83-9008833e3901@suse.de> <87pmnt7gm3.fsf@intel.com> <5ee24960-7843-827a-2c47-b93a4b4798e3@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5ee24960-7843-827a-2c47-b93a4b4798e3@suse.de> X-Patchwork-Hint: comment X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Mon, Feb 14, 2022 at 01:12:48PM +0100, Thomas Zimmermann wrote: > Hi > > Am 14.02.22 um 11:38 schrieb Andy Shevchenko: > > On Mon, Feb 14, 2022 at 10:03:53AM +0100, Thomas Zimmermann wrote: > >> Am 11.02.22 um 16:41 schrieb Andy Shevchenko: > > > > ... > > > >>>> IMO *always* prefer a for loop over while or do-while. > >>>> > >>>> The for (i = 0; i < N; i++) is such a strong paradigm in C. You > >>>> instantly know how many times you're going to loop, at a glance. Not so > >>>> with with the alternatives, which should be used sparingly. > >>> > >>> while () {} _is_ a paradigm, for-loop is syntax sugar on top of it. > >> > >> Naw, that's not true. > > > > In the section 3.5 "Loops - While and For" in "The C Programming > > Language" 2nd by K&R, the authors said: > > Year of publication: 1988 . It's not the most up-to-date reference for C > programming. > > > > > The for statement ... is equivalent to ... while..." > > > > They said that for is equivalent to while, and not otherwise. > > Even leaving readability aside, it's not equivalent. You can declare > variables as part of the for statement. (I know it's not the kernel's > style.) Also, 'continue' statements are not well-suited in for loops, > because it's non-obvious if the loop's update statement is being > executed. (It isn't.) It is. 'continue' is just shorthand for 'goto end_of_loop_body'. -- Ville Syrj?l? Intel