Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp637175imm; Mon, 9 Jul 2018 08:03:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfg+CMNsZ/2/GN5GvFed05Uo4iVwsmfZlR92xr+FXMko5oP3MxZ+941JhQk1DuhilDWQKbv X-Received: by 2002:a62:5dd7:: with SMTP id n84-v6mr21833804pfj.68.1531148582818; Mon, 09 Jul 2018 08:03:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531148582; cv=none; d=google.com; s=arc-20160816; b=uzM5P9ADwfchrSOmTDkt/H9JjdOovnVfMSudDXl4AvjJyLGgMAg64TEGujp69qN/L4 AYqUelzRvRCGHAUjlcNlnimreb5f7DyrEJJYFfKrXxqGAQCDC52uwt0U8axeUjC3LFgo TyiE7ASBnlQnRZGCd7t3aOEo+rN/b0T4CcN8Cx6oHVjyLBUpkN7meE754Lomq6KPaGc3 ToVqajBLpfHI/MumpqgUbmjPdXrUKzUWqOVpRgl41MeAcxv3te2dfWThCMMC+cesIxKD t3j+9xBUdH7tRoHajxapEzIk5GOvQcNHDWzhNfXBAKhWMmPPFxZu/X0VxAvD5Oeocep8 5/Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=8Vtcl7bW8s9nMyA3kb86pmtRoEXWWpeCeD6YMwVsuOc=; b=DLHLw+1DshXToJgMQB/v3SueS4acxMMRiCY0h2+/+9b2CwJTjelUwvaQXjHCwwBeQs jc3rU5LNAcsKYDbPd3jtjUdS2fWYac3Vlv6o9c9lDGudGPam99By95gdzvyuffsRNwxf AnMOgzyG6xsi4gLAzBp11Hf+UO2YUINpNR74rQbPs/y6qV5zLnpzRSHf62SLdDbrlCeL 5Wbl+N9w8ZaIjbJNGjXp+UcmKBGekYuuhLEtTSDDNOOLngPJx+DfuYxKyQIsTy6HFaMQ 5B2M8G5JNGD4FVEj4j81fya5j7kgtYEm+fuzo06/2bZsZDfl559TliHH6RExsoYO1p4b nBqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=Zpg7avSZ; 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 b13-v6si812628pgh.255.2018.07.09.08.02.48; Mon, 09 Jul 2018 08:03:02 -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=pass header.i=@ffwll.ch header.s=google header.b=Zpg7avSZ; 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 S933216AbeGIPAK (ORCPT + 99 others); Mon, 9 Jul 2018 11:00:10 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:34841 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932903AbeGIPAJ (ORCPT ); Mon, 9 Jul 2018 11:00:09 -0400 Received: by mail-it0-f67.google.com with SMTP id l16-v6so26826540ita.0 for ; Mon, 09 Jul 2018 08:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8Vtcl7bW8s9nMyA3kb86pmtRoEXWWpeCeD6YMwVsuOc=; b=Zpg7avSZQdJfPbaAs1pMsbx5QxxmutPK0K95yVhpISUs8HVsg2hWcoVOgGPnQYX9D/ Uwh7jG/blLhJLzCVHA9DVi5rRECaxxJ/lSs3g8tVH67lqAtzan15Jpt7tv0vSZ4afhO6 06WGtPa3hDlpE4oTc9OK/j66rfDgpu1fd4X5g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8Vtcl7bW8s9nMyA3kb86pmtRoEXWWpeCeD6YMwVsuOc=; b=SiSU34cdIt6dq6pnmZKFnEYqFjsf1Pp9GYXhiF6tQApOscpm8VElEk29WJ83rxnNNR loSrIBNepxgTOOCHcymskYvDkS9H0MNJYbljg1mcqiPq5AeWpgyBQ9ybDChn3svXnTqe GJW1YXhf9SjAqdRld36bL12uj0JBWDyv9S0cXAe7runFIlUMKzteAkaJjJxxSP/YIpP4 fZIPR+2jGcddXWagN8KPK/J4IKT5jAfIRbHjhn8wlWYfVtDXhIiPhwX31vWWx8jjl/YI pfn+M/7nhzikE4vpGvZhUJVUIbEJekBceK4i/8dy4SHOgSe/vFNMjLW8lU5Tr39AUgyK 1VrA== X-Gm-Message-State: AOUpUlFfqUB2yVCS1YbU+o5/pdcPZh8sziHXtRP/3ykghfaynIRU98OW /LYxOMGvp3LOq+B0qDWJQrM+tydDpMWtNbvO8AYktg== X-Received: by 2002:a24:558a:: with SMTP id e132-v6mr5592669itb.2.1531148408326; Mon, 09 Jul 2018 08:00:08 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:e492:0:0:0:0:0 with HTTP; Mon, 9 Jul 2018 08:00:07 -0700 (PDT) X-Originating-IP: [2a02:168:5628:0:496f:7dc5:66d7:a057] In-Reply-To: <20180709103656.GH2476@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> From: Daniel Vetter Date: Mon, 9 Jul 2018 17:00:07 +0200 Message-ID: Subject: Re: [PATCH 11/12] sched: use for_each_if in topology.h To: Peter Zijlstra Cc: LKML , DRI Development , Intel Graphics Development , Daniel Vetter , Andrew Morton Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 9, 2018 at 12:36 PM, Peter Zijlstra wrote: > On Mon, Jul 09, 2018 at 10:36:49AM +0200, Daniel Vetter wrote: >> Avoids complaints from gcc about ambiguous else clauses. > > Is that a new thing? I'm fairly sure I've never seen it do that, > >> Signed-off-by: Daniel Vetter >> Cc: Andrew Morton >> Cc: Peter Zijlstra >> --- >> include/linux/topology.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/include/linux/topology.h b/include/linux/topology.h >> index cb0775e1ee4b..4fba5a5b148d 100644 >> --- a/include/linux/topology.h >> +++ b/include/linux/topology.h >> @@ -40,7 +40,7 @@ >> >> #define for_each_node_with_cpus(node) \ >> for_each_online_node(node) \ >> - if (nr_cpus_node(node)) >> + for_each_if (nr_cpus_node(node)) > > Not having gotten any of the other patches, I'm not really sure what > this does and such, but improve readability it does not :/ Patch 1 in this series, which I dumped onto lkml as a whole: https://lkml.org/lkml/2018/7/9/179 Imo it does improve readability for the if (!cond) {} else pattern. And (assuming my grep fu isn't too badly wrong) most places in the kernel do use this pattern in for_each macros, so I guess its a real thing. We've definitely hit it plenty in drm iterators (but we seem to like if() checks in iterator macros maybe a bit too much). I'm happy to drop this patch tough if you deem it offensive. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch