Re: [PATCH] sh: mach-rsk: rsk7203: avoid using inline compound literals
From: John Paul Adrian Glaubitz
Date: Mon Aug 03 2026 - 01:48:16 EST
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?
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913