Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp728156imm; Mon, 9 Jul 2018 09:32:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfG6l7+QH1nANssEBNt/eaYjmcXbbDc/VpUcgjzL/tde3TP8L8YtXA6mqADg3HClYJCAmF4 X-Received: by 2002:a17:902:a515:: with SMTP id s21-v6mr21077555plq.192.1531153954323; Mon, 09 Jul 2018 09:32:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531153954; cv=none; d=google.com; s=arc-20160816; b=Zx+5bwEVE+aWIjCOJRKGU1hlO7G6m4N+kuBrY6J6rWjC5QwlJ0mHb/C2dl4cEGeOwh 0H5x90Eou5vtqztSwy6ozQjEz8al3up4/llLUiAk5heWuGEbrcpzJ9wkhiJdomsSEhgX qCLAwj+X4Fy1D0RcD85WPRNORX/8GKrZe9FNTtn/Y6eKgCG79h74AQBimjVnu0t5owA2 nluz9oTRnGzuBsyqFsjPqy+R7kMgAbKLXKzqIi1NJZX8VUOF+3WOfuGHNnLZ8hhEZ39G IEGAMZ+icvKVaiDqt3NYg/pMQMmBdO0R5on8U4rNJYG5FzvAZ726YRwbyaMcRR6cXQ/B xtQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :from:date:dkim-signature:arc-authentication-results; bh=GI7wjWFg9FGJGV0rSVskFibXKKuTgM2Pt/ilSBrnXi4=; b=VJNmpPBeYhS4rw+cggoqZOwFnPIq2DxPXpPEYsdRaW+VzEQuYTZ2mbTLUwvFf2zozF AfR2OZ4x8tYgiKxD7CSslQ/PTEeuIOf2/yMBbxNCpb0Kwvx19ZOtzcY3SaUw0d2n+upX 5/0wFE8KMR2xuWtRbwSOKIRRyv0IfK/jIooaLeNncBbR7O+Yrk82RTRCDH9kEjwSaJwK zbH1YpFYheqYdSpoaM8eQ+CbNwM30T5gt6Xg3zeCcad/wLYxdbj5hSZ7rxdprQdviMzY qG3LUV0CslRtBX+rC+ooQfO3cnzCu8JhLhzL7IaXPBwcJw7qZ6PguyWCcDX29F+oGy1U RCag== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=bauIVkCn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6-v6si15675770pfa.217.2018.07.09.09.32.19; Mon, 09 Jul 2018 09:32:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=bauIVkCn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933183AbeGIQa3 (ORCPT + 99 others); Mon, 9 Jul 2018 12:30:29 -0400 Received: from merlin.infradead.org ([205.233.59.134]:36854 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932845AbeGIQa2 (ORCPT ); Mon, 9 Jul 2018 12:30:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=GI7wjWFg9FGJGV0rSVskFibXKKuTgM2Pt/ilSBrnXi4=; b=bauIVkCnpD5eesXEdfNZXEZGp dK2sjlv0Tv9BYlNK5ibRv0p/5advxuU247rWOPWQl5OSdOScsqih811LgiOKoIMZlDfAoGuTddyOm XzU9pZRi/OdU/jQ2hZ3SDrUvyXvAJbugp6yx3lRWW6rVZJUgadMVlA8qqCYkoW6JCIzHPVx4ViDA/ nQzXpblbQbnBEW/mi3bgYnIXmK+Ahw+m2ZGB5yapDXh3UFMxBXFpkWenn58KUcmoIfBKSIkRntIJ7 mTpofzWYcqe5zAEw2B/Jw1hysXbxcXf6KioBtNvFpbfpjmIETZ+UaYpSXSDbaZDNuZgs/KmuGIzGj bn5G3M+Cw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fcZ3R-00053N-UL; Mon, 09 Jul 2018 16:30:26 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 25A9920289CF4; Mon, 9 Jul 2018 18:30:23 +0200 (CEST) Date: Mon, 9 Jul 2018 18:30:23 +0200 From: Peter Zijlstra To: LKML , DRI Development , Intel Graphics Development , Daniel Vetter , Andrew Morton Subject: Re: [PATCH 11/12] sched: use for_each_if in topology.h Message-ID: <20180709163023.GB2476@hirez.programming.kicks-ass.net> References: <20180709083650.23549-1-daniel.vetter@ffwll.ch> <20180709083650.23549-11-daniel.vetter@ffwll.ch> <20180709103656.GH2476@hirez.programming.kicks-ass.net> <20180709151258.GV2476@hirez.programming.kicks-ass.net> <20180709155204.GD3008@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180709155204.GD3008@phenom.ffwll.local> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 09, 2018 at 05:52:04PM +0200, Daniel Vetter wrote: > for_each_something(foo) > if (foo->bla) > call_bla(foo); > else > call_default(foo); Note that the kernel coding style 'discourages' this style and would like you to write: for_each_something(foo) { if (foo->bla) call_bla(foo); else call_default(foo); } Which avoids the entire problem. See CodingStyle-3: Also, use braces when a loop contains more than a single simple statement: .. code-block:: c while (condition) { if (test) do_something(); }