Re: [PATCH] sh: mach-rsk: rsk7203: avoid using inline compound literals

Dmitry Torokhov <[email protected]> Sun, 2 Aug 2026 23:07:09 -0700
Newsgroups gmane.linux.ports.sh.devel,gmane.linux.kernel
Message-ID <[email protected]>
On Mon, Aug 03, 2026 at 07:47:50AM +0200, John Paul Adrian Glaubitz wrote:
> Hello Dmitry,
> 
> On Sun, 2026-08-02 at 16:18 -0700, Dmitry Torokhov wrote:
> > Using inline compound literals for property entries in software node
> > initializers causes older compilers (GCC < 14) to fail with "initializer
> > element is not constant".
> > 
> > Under C11 (6.6/6.7.9), initializers for objects with static storage
> > duration must be constant expressions. Taking the address of an unnamed
> > compound literal nested inside an anonymous compound literal array is
> > not guaranteed by standard C to be a compile-time constant address,
> > causing older GCC versions to reject it.
> > 
> > Fix this by declaring property entry arrays as named static const
> > variables, ensuring their symbols evaluate to unambiguous compile-time
> > address constants.
> > 
> > Fixes: 6905cdac0e51 ("sh: mach-rsk: rsk7203: use static device properties for LEDs and GPIO buttons")
> 
> Isn't that the patch that was forced into the kernel, overriding me
> as the maintainer of arch/sh because Linus Walleij got impatient and
> merged the patch into an immutable tree?

Yes, but incompatibility with older GCCs is not something that you'd
recognize on the spot, would you?

Also, you seem to be hung up on the notion of immutable branch. This is
simply a branch that creator promises not to rewind/rebase so that it
can be easily shared between different subsystems.

While we are at this, there are a few more patch series for SH that I
would like you to take a look at, pretty please...

Thanks.

-- 
Dmitry