Re: [PATCH net-next 08/11] ath9k: work around false-positive gcc warning

From: Arnd Bergmann
Date: Mon Nov 02 2020 - 17:29:35 EST


On Mon, Nov 2, 2020 at 7:01 PM Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote:
> On Mon, 2020-11-02 at 18:26 +0200, Kalle Valo wrote:
> > Arnd Bergmann <arnd@xxxxxxxxxx> writes:
> > > From: Arnd Bergmann <arnd@xxxxxxxx>
> >
> > Isn't there a better way to handle this? I really would not want
> > checking for GCC versions become a common approach in drivers.
> >
> > I even think that using memcpy() always is better than the ugly ifdef.
>
> If you put memcpy() always somebody will surely go and clean it up to
> use ether_addr_copy() soon ...
>
> That said, if there's a gcc issue with ether_addr_copy() then how come
> it's specific to this place?

I have not been able to figure this out, hopefully some gcc developer
eventually looks at the bug in more detail.

Presumably it has something to do with the specific way the five levels
of structures are nested here, and how things get inlined in this driver.
If the bug happened everywhere, it would likely have been found and
fixed earlier.

Arnd