On Sat, Dec 09, 2023 at 11:47:49AM +0100, Arnd Bergmann wrote:
On Sat, Dec 9, 2023, at 03:46, Sasha Levin wrote:
This is a note to let you know that I've just added the patch titled
Kbuild: move to -std=gnu11
to the 5.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
kbuild-move-to-std-gnu11.patch
and it can be found in the queue-5.15 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.
I think the patch initially caused a few regressions, so
I'm not sure if backporting this is the best idea. Is this
needed for some other backport?
Hey Arnd,
I spent some time over the weeked trying to figure it out. Initially it
looked like there's something wrong with my local toolchain, but what I
found out is the following:
There is now kernel code relying on code constructs that are illegal
without c99/gnu11/etc. The example in this case is WMI code which even
in upstream [1] does:
list_for_each_entry(wblock, &wmi_block_list, list) {
/* skip warning and register if we know the driver will use struct wmi_driver */
for (int i = 0; allow_duplicates[i] != NULL; i++) {
^^^^^^^^^^^
if (guid_parse_and_compare(allow_duplicates[i], guid))
return false;
The decleration of a variable there doesn't work unless you're using a
newer standard, which is why the dependency bot ended up pulling this
commit in.
At this point, not taking this change means that we can't take some
commits without doing custom changes to backport them, which in turn
means that we'll keep diverging from upstream.
Agreeing with you that this isn't a trivial change, but it seems that we
need to take it to make even not-that-old trees (<=5.15) accept some
fixes.
With the commit in question applied I see no new errors or warnings, so
I'll keep it in 5.15, and we can see how it survives the -rc tests.
I haven't seen any fixes pointing to that commit besides a documentation
fix, so if I've missed anything please let me know.
[1]: https://elixir.bootlin.com/linux/v6.7-rc5/source/drivers/platform/x86/wmi.c#L1289
--
Thanks,
Sasha