[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ylg8baQjQTkrnnD9@hirez.programming.kicks-ass.net>
Date: Thu, 14 Apr 2022 17:23:25 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Christophe de Dinechin <dinechin@...hat.com>
Cc: trivial@...nel.org, Ben Segall <bsegall@...gle.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>, Mel Gorman <mgorman@...e.de>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Jason Wang <jasowang@...hat.com>,
virtualization@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org,
Zhen Lei <thunder.leizhen@...wei.com>,
Juri Lelli <juri.lelli@...hat.com>
Subject: Re: [PATCH 2/3] nodemask.h: Fix compilation error with GCC12
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?
Powered by blists - more mailing lists