Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp393723pxb; Tue, 15 Feb 2022 16:22:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWHTtbhRl7cSwix7UR+owDsqeky/kxPT//sCpuhhQgAr5xKI3ZJypZ3+/RiCS6C0YxsRXL X-Received: by 2002:a17:906:a10:b0:6ce:7107:598b with SMTP id w16-20020a1709060a1000b006ce7107598bmr306377ejf.653.1644970964256; Tue, 15 Feb 2022 16:22:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644970964; cv=none; d=google.com; s=arc-20160816; b=SyGKVb0/AnauH/6deRIgOiBiiwTbgpbYzQFHu3eXaDNZFGTsOt4Z8HeMz4HGjQ4KSd KwW/1xyJBXcE2eka+i0uZLwV86FLtoqqQStx+zkkDhTq+HpOdkXMg7ZNuhwFltPm1e5H Zt60d8/2jb6m2fEW7pagyui6YP3jGT1Rlgds0BDCxXqX5K3mq+lzz4q8sqLZlfBEUBwD GLGGi0HhIC5w+eKworyQmFYIi2eoXgWejmrpKm/O0PekVCmbk2L+b4+iel4S1YChuJr/ LknPjGdO8Xj4iWj719qo1g42YLydOZJD/hgjO+gPr5ZEwDj+1UpGO7guEhEUs5I69InA 9cVA== 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=SPFmk4HkbfEyOKXLjdftDo8Qv7tvrNf8TMLyhn0OhHw=; b=ubYUFKa1pqbOTeIjyV5tx4paT0UPaIuA37eJigJZVRfelGaVZa+1Wc0NXsElabslQA wsuHoNQzS75Y3t0TX25Be+gP1CBTvAqoqHqy7KcpFldAMwOOgeQti3TwjmDhn9Zopy8C v/Cc3gsWE2iHt474EEdpeqI9f+ESU63qMafBj3Ee5HwaQByLWMzhbm7EnzvjIhPL4BmG ZBLvf8jBfKHTmrP4HyZj5VqYZ3VhPri26pLkFX8Fx+0k2KzCYmwP7LiOIIeLVIvo51Nu z1VL6Zb/I+sy3Z6EF6Ty3dyFAEBGEb5CwoJouxEI2hse37pPL3f2+2/T/9KcZ3cmq2pW BnXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ibYfSP6B; 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 m24si1399155eje.897.2022.02.15.16.22.21; Tue, 15 Feb 2022 16:22:44 -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=ibYfSP6B; 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 S243322AbiBOS7m (ORCPT + 99 others); Tue, 15 Feb 2022 13:59:42 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235944AbiBOS7l (ORCPT ); Tue, 15 Feb 2022 13:59:41 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 674DCEB33E for ; Tue, 15 Feb 2022 10:59:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644951571; x=1676487571; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=whwP9Db5MNSBKpAGicysWN+UADdsEBzGUgWDC7WFI5w=; b=ibYfSP6BU852w/cFUfsBn/ugJp2Y3gA2qvc1Z20Zi5JUexhdy3sUFwX4 GTK8/Dqtq0tEfA0YuVFrSnz4XPq8YpXLp7V0+vn2atA9xjjrXrZUKaMAX 3RsfmNmH8TsLxJGw4D8yF1h0dNaoeYJNNx7kOwUh9kWEOnEiqNN9ZggGq MGnGa16Pg9kSXNDApljTIrWndAIwRm76lW6KdG6GfUcV4Lk9oLYTTGIfH X52tZfE3t8SqO2pcYpYNyKugWm21TZrUE9IUAzevvTN6X86bCm+CQuGxW 1147xC9wVyaNCAry3W5abVKS07+1K/ECA0dWzZ1Q3Bk9ELcJsBwBPv+Pa w==; X-IronPort-AV: E=McAfee;i="6200,9189,10259"; a="230392431" X-IronPort-AV: E=Sophos;i="5.88,371,1635231600"; d="scan'208";a="230392431" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2022 10:59:31 -0800 X-IronPort-AV: E=Sophos;i="5.88,371,1635231600"; d="scan'208";a="636072634" Received: from smile.fi.intel.com ([10.237.72.59]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2022 10:59:27 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nK320-0051ub-M8; Tue, 15 Feb 2022 20:58:32 +0200 Date: Tue, 15 Feb 2022 20:58:32 +0200 From: Andy Shevchenko To: Jani Nikula Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Thomas Zimmermann , Geert Uytterhoeven Subject: Re: [PATCH v1 1/1] drm/i915/selftests: Replace too verbose for-loop with simpler while Message-ID: References: <20220215163213.54917-1-andriy.shevchenko@linux.intel.com> <87o83859x2.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87o83859x2.fsf@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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_PASS, 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 Tue, Feb 15, 2022 at 07:14:49PM +0200, Jani Nikula wrote: > On Tue, 15 Feb 2022, Andy Shevchenko wrote: > > It's hard to parse for-loop which has some magic calculations inside. > > Much cleaner to use while-loop directly. > > I assume you're trying to prove a point following our recent > for-vs-while loop discussion. I really can't think of any other reason > you'd end up looking at this file or this loop. > > With the change, the loop indeed becomes simpler, but it also runs one > iteration further than the original. Whoops. Yeah, sorry for that, the initial condition should be d = depth - 1, of course. > It's a selftest. The loop's been there for five years. What are we > trying to achieve here? So we disagree on loops, fine. Perhaps this is > not the best use of either of our time? Please just let the for loops in > i915 be. Yes, I'm pretty much was sure that no-one will go and apply this anyway (so I haven't paid too much attention), but to prove my point in the certain discussion. And yes, the point is for the new code, I'm not going to change existing suboptimal and too hard to read for-loops, it will consume my time later when I will try to understand the code. -- With Best Regards, Andy Shevchenko