Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1030642pxb; Fri, 15 Apr 2022 18:57:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw16FsVoJz66iQvHqOqwGg1fNBOy1Af72vp/d4w0JCnTR6C8Ge3yREVPitM91lADB9K/xtU X-Received: by 2002:a17:902:e0ca:b0:158:cc0a:44f7 with SMTP id e10-20020a170902e0ca00b00158cc0a44f7mr1445914pla.70.1650074264997; Fri, 15 Apr 2022 18:57:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650074264; cv=none; d=google.com; s=arc-20160816; b=uIiauBice3zosz056u7wkPm9k7uY//IJ3kPSb3QEEPelou+8agfiNL9pHUgbHttU0K oCwKdeKHq/mlppA7EnJv2OLULqPGInSt+4MFNgjYLPp3mO3QU8EgYIK4fP4UtTcR1NPt iOGkZgxSRSF1algVY56o5E4vQM+cFrZ+0jT6k6rbjzJUL9TlBY0tRVpau3W8TGfvM2iz IqwpGK7WnBpVv/xb6QiigoxHWTYCvnLtDOXRlecTmod4fNfycYmSC7ubVCGVIoYkS/ty otXflgtolYwi4wdtxeY611wwYYTCKzPk/jXMTAEHTwD2rhVcxV6PTsI4wTRtMPyhLlWk z76w== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=a7zF3jN+ZuZUeKxEZxyh6BUyYjHKt2ke+Gaa4KDb6Ss=; b=CfcJNcbSg4ePZ7eimSJvi6+G8xqEMnTX6/ekYOukVSWR3IJ/z86M3xJcxqxWAx8Bmh W8agRM8X07UusPvDsBAHtsya/Jpm+0uY0V0C96t/VOKWLrpami7Vb77DMs0D8fOIX+Q9 yhJE4av20qwEAp5jCGB/yt06wPwEe1KKcT2CXfKN3Q7/cZ57CfqxIQ0TxlJTcwCfPeoZ 6L2pl4HNfVkxtGE7UMZPYrJxXQ3XE2IbBG2Wf9s3rj2FIpgf9kQ2UQiKC2MkqjZrvTXO onZ8XJfoZWbXX1/DNIkFOi7BxFqyr22XDQxkjN3EjWIu4FWyhTNAoIRvC6T2PLDJS6JO XWCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=JI7UTDpP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i15-20020a6561af000000b0038207e00911si2874365pgv.540.2022.04.15.18.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 18:57:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=JI7UTDpP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 192A51070AE; Fri, 15 Apr 2022 18:18:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344037AbiDNP6t (ORCPT + 99 others); Thu, 14 Apr 2022 11:58:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358382AbiDNPll (ORCPT ); Thu, 14 Apr 2022 11:41:41 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3D6AECDA4 for ; Thu, 14 Apr 2022 08:24:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=a7zF3jN+ZuZUeKxEZxyh6BUyYjHKt2ke+Gaa4KDb6Ss=; b=JI7UTDpPYhqXfQKCuMEmYAowpM KIhHEIS1dFUdiL/5HF6Ars5OntlUd2gqm+jpr8egpvGlWNYIvboqCNJV5AEHMDPviYf2LtankgtO1 aN63NIxsiNrqgH/yec/1SBUhuUGXoD2DhaigfktalJ0QviP9lT4XfmUbyBSFrbRBu46E+wkhKg29P S5TTuXj3ELigIDn7xfH0U6QP8z8oaktVYWwuKrTIFGTJi0OdSidmRIzUj2ESbknagmLuFJ3Tcl4l5 JR/BZZsqY69LwJApHxjCus6gVVR/R4DXR1bg70z3O9MRZOrdswtpHtL5/LTTA5zD+Tu82Nrb7YNY7 +kx8Q6GA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nf1Jd-00FEUn-VO; Thu, 14 Apr 2022 15:23:26 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 80B2C3002DE; Thu, 14 Apr 2022 17:23:25 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 434D631B56D1F; Thu, 14 Apr 2022 17:23:25 +0200 (CEST) Date: Thu, 14 Apr 2022 17:23:25 +0200 From: Peter Zijlstra To: Christophe de Dinechin Cc: trivial@kernel.org, Ben Segall , "Michael S. Tsirkin" , Andrew Morton , Steven Rostedt , Ingo Molnar , Mel Gorman , Dietmar Eggemann , Vincent Guittot , Paolo Bonzini , Daniel Bristot de Oliveira , Jason Wang , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Zhen Lei , Juri Lelli Subject: Re: [PATCH 2/3] nodemask.h: Fix compilation error with GCC12 Message-ID: References: <20220414150855.2407137-1-dinechin@redhat.com> <20220414150855.2407137-3-dinechin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220414150855.2407137-3-dinechin@redhat.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Thu, Apr 14, 2022 at 05:08:54PM +0200, Christophe de Dinechin wrote: > diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h > index 567c3ddba2c4..c6199dbe2591 100644 > --- a/include/linux/nodemask.h > +++ b/include/linux/nodemask.h > @@ -375,14 +375,13 @@ static inline void __nodes_fold(nodemask_t *dstp, const nodemask_t *origp, > } > > #if MAX_NUMNODES > 1 > -#define for_each_node_mask(node, mask) \ > - for ((node) = first_node(mask); \ > - (node) < MAX_NUMNODES; \ > - (node) = next_node((node), (mask))) > +#define for_each_node_mask(node, mask) \ > + for ((node) = first_node(mask); \ > + (node >= 0) && (node) < MAX_NUMNODES; \ > + (node) = next_node((node), (mask))) > #else /* MAX_NUMNODES == 1 */ > -#define for_each_node_mask(node, mask) \ > - if (!nodes_empty(mask)) \ > - for ((node) = 0; (node) < 1; (node)++) > +#define for_each_node_mask(node, mask) \ > + for ((node) = 0; (node) < 1 && !nodes_empty(mask); (node)++) > #endif /* MAX_NUMNODES */ Again, less readable code :/ And why?