[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK8P3a38r0PwHJUVhtV379+YZgkRpr+gfaRJK_V+ddHu4vEuDg@mail.gmail.com>
Date: Thu, 4 Nov 2021 15:39:21 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Matthew Wilcox <willy@...radead.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Arnd Bergmann <arnd@...db.de>,
"Uladzislau Rezki (Sony)" <urezki@...il.com>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Nicholas Piggin <npiggin@...il.com>,
Michal Hocko <mhocko@...e.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
Chen Wandun <chenwandun@...wei.com>,
David Hildenbrand <david@...hat.com>,
Linux-MM <linux-mm@...ck.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: vmap: avoid -Wsequence-point warning
On Thu, Nov 4, 2021 at 2:57 PM Matthew Wilcox <willy@...radead.org> wrote:
> On Thu, Nov 04, 2021 at 02:35:40PM +0100, Arnd Bergmann wrote:
> >
> > This only appeared in one randconfig build so far, and I don't know
> > what caused it, but moving the index increment out of the expression
> > at least addresses the warning.
>
> Would that randconfig include CONFIG_ARM64_PA_BITS_52?
>
> #define __phys_to_pte_val(phys) (((phys) | ((phys) >> 36)) & PTE_ADDR_MASK)
>
> because that's going to double-increment idx. Or single increment.
> Or whatever else the compiler feels like doing.
Ok, got it. I've got a new patch turning that into an inline function now,
which seems like a more reliable fix. I still don't see why the warning only
showed up now, as both the caller and the definition of __phys_to_pte_val()
are not that new, and I've been testing with gcc-11 for a while now.
Arnd
Powered by blists - more mailing lists