Re: [PATCH] sh: mach-rsk: rsk7203: avoid using inline compound literals
John Paul Adrian Glaubitz <[email protected]> Mon, 03 Aug 2026 07:47:50 +0200
| Newsgroups | gmane.linux.ports.sh.devel,gmane.linux.kernel |
|---|---|
| Message-ID | <32a0d810bfc56029453aa72cefa49cb40466f64e.camel@physik.fu-berlin.de> |
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".
>=20
> 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.
>=20
> Fix this by declaring property entry arrays as named static const
> variables, ensuring their symbols evaluate to unambiguous compile-time
> address constants.
>=20
> 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
--=20
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913