From: Greg Kroah-Hartman Date: Tue, 12 Dec 2023 11:56:53 +0000 (+0100) Subject: fix up a 5.15 patch and drop the gnu11 change. X-Git-Tag: v4.14.333~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7135dd6ae0a667ec87f5900e27524a3d3acc0d42;p=thirdparty%2Fkernel%2Fstable-queue.git fix up a 5.15 patch and drop the gnu11 change. --- diff --git a/queue-5.15/kbuild-move-to-std-gnu11.patch b/queue-5.15/kbuild-move-to-std-gnu11.patch deleted file mode 100644 index 78c0542e358..00000000000 --- a/queue-5.15/kbuild-move-to-std-gnu11.patch +++ /dev/null @@ -1,157 +0,0 @@ -From ad2a1dd4c3c6bdf8c928604927415ba7e4016008 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 8 Mar 2022 22:56:14 +0100 -Subject: Kbuild: move to -std=gnu11 - -From: Arnd Bergmann - -[ Upstream commit e8c07082a810fbb9db303a2b66b66b8d7e588b53 ] - -During a patch discussion, Linus brought up the option of changing -the C standard version from gnu89 to gnu99, which allows using variable -declaration inside of a for() loop. While the C99, C11 and later standards -introduce many other features, most of these are already available in -gnu89 as GNU extensions as well. - -An earlier attempt to do this when gcc-5 started defaulting to --std=gnu11 failed because at the time that caused warnings about -designated initializers with older compilers. Now that gcc-5.1 is -the minimum compiler version used for building kernels, that is no -longer a concern. Similarly, the behavior of 'inline' functions changes -between gnu89 using gnu_inline behavior and gnu11 using standard c99+ -behavior, but this was taken care of by defining 'inline' to include -__attribute__((gnu_inline)) in order to allow building with clang a -while ago. - -Nathan Chancellor reported a new -Wdeclaration-after-statement -warning that appears in a system header on arm, this still needs a -workaround. - -The differences between gnu99, gnu11, gnu1x and gnu17 are fairly -minimal and mainly impact warnings at the -Wpedantic level that the -kernel never enables. Between these, gnu11 is the newest version -that is supported by all supported compiler versions, though it is -only the default on gcc-5, while all other supported versions of -gcc or clang default to gnu1x/gnu17. - -Link: https://lore.kernel.org/lkml/CAHk-=wiyCH7xeHcmiFJ-YgXUy2Jaj7pnkdKpcovt8fYbVFW3TA@mail.gmail.com/ -Link: https://github.com/ClangBuiltLinux/linux/issues/1603 -Suggested-by: Linus Torvalds -Acked-by: Marco Elver -Acked-by: Jani Nikula -Acked-by: David Sterba -Tested-by: Sedat Dilek -Reviewed-by: Alex Shi -Reviewed-by: Nick Desaulniers -Reviewed-by: Miguel Ojeda -Signed-off-by: Arnd Bergmann -Reviewed-by: Nathan Chancellor -Signed-off-by: Masahiro Yamada -Signed-off-by: Sasha Levin ---- - Documentation/process/programming-language.rst | 6 +++--- - .../translations/it_IT/process/programming-language.rst | 4 ++-- - .../translations/zh_CN/process/programming-language.rst | 3 +-- - .../translations/zh_TW/process/programming-language.rst | 3 +-- - Makefile | 4 ++-- - arch/arm64/kernel/vdso32/Makefile | 2 +- - 6 files changed, 10 insertions(+), 12 deletions(-) - -diff --git a/Documentation/process/programming-language.rst b/Documentation/process/programming-language.rst -index ec474a70a02fa..5fc9160ca1fa5 100644 ---- a/Documentation/process/programming-language.rst -+++ b/Documentation/process/programming-language.rst -@@ -5,9 +5,9 @@ Programming Language - - The kernel is written in the C programming language [c-language]_. - More precisely, the kernel is typically compiled with ``gcc`` [gcc]_ --under ``-std=gnu89`` [gcc-c-dialect-options]_: the GNU dialect of ISO C90 --(including some C99 features). ``clang`` [clang]_ is also supported, see --docs on :ref:`Building Linux with Clang/LLVM `. -+under ``-std=gnu11`` [gcc-c-dialect-options]_: the GNU dialect of ISO C11. -+``clang`` [clang]_ is also supported, see docs on -+:ref:`Building Linux with Clang/LLVM `. - - This dialect contains many extensions to the language [gnu-extensions]_, - and many of them are used within the kernel as a matter of course. -diff --git a/Documentation/translations/it_IT/process/programming-language.rst b/Documentation/translations/it_IT/process/programming-language.rst -index 41db2598ce119..c1a9b481a6f99 100644 ---- a/Documentation/translations/it_IT/process/programming-language.rst -+++ b/Documentation/translations/it_IT/process/programming-language.rst -@@ -10,8 +10,8 @@ Linguaggio di programmazione - - Il kernel è scritto nel linguaggio di programmazione C [it-c-language]_. - Più precisamente, il kernel viene compilato con ``gcc`` [it-gcc]_ usando --l'opzione ``-std=gnu89`` [it-gcc-c-dialect-options]_: il dialetto GNU --dello standard ISO C90 (con l'aggiunta di alcune funzionalità da C99). -+l'opzione ``-std=gnu11`` [it-gcc-c-dialect-options]_: il dialetto GNU -+dello standard ISO C11. - Linux supporta anche ``clang`` [it-clang]_, leggete la documentazione - :ref:`Building Linux with Clang/LLVM `. - -diff --git a/Documentation/translations/zh_CN/process/programming-language.rst b/Documentation/translations/zh_CN/process/programming-language.rst -index 2a47a1d2ec20f..fabdc338dbfbc 100644 ---- a/Documentation/translations/zh_CN/process/programming-language.rst -+++ b/Documentation/translations/zh_CN/process/programming-language.rst -@@ -9,8 +9,7 @@ - ============ - - 内核是用C语言 :ref:`c-language ` 编写的。更准确地说,内核通常是用 :ref:`gcc ` --在 ``-std=gnu89`` :ref:`gcc-c-dialect-options ` 下编译的:ISO C90的 GNU 方言( --包括一些C99特性) -+在 ``-std=gnu11`` :ref:`gcc-c-dialect-options ` 下编译的:ISO C11的 GNU 方言 - - 这种方言包含对语言 :ref:`gnu-extensions ` 的许多扩展,当然,它们许多都在内核中使用。 - -diff --git a/Documentation/translations/zh_TW/process/programming-language.rst b/Documentation/translations/zh_TW/process/programming-language.rst -index 54e3699eadf85..144bdaf81a416 100644 ---- a/Documentation/translations/zh_TW/process/programming-language.rst -+++ b/Documentation/translations/zh_TW/process/programming-language.rst -@@ -12,8 +12,7 @@ - ============ - - 內核是用C語言 :ref:`c-language ` 編寫的。更準確地說,內核通常是用 :ref:`gcc ` --在 ``-std=gnu89`` :ref:`gcc-c-dialect-options ` 下編譯的:ISO C90的 GNU 方言( --包括一些C99特性) -+在 ``-std=gnu11`` :ref:`gcc-c-dialect-options ` 下編譯的:ISO C11的 GNU 方言 - - 這種方言包含對語言 :ref:`gnu-extensions ` 的許多擴展,當然,它們許多都在內核中使用。 - -diff --git a/Makefile b/Makefile -index 5976e71522607..fb1517f05c3ff 100644 ---- a/Makefile -+++ b/Makefile -@@ -524,7 +524,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \ - -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \ - -Werror=implicit-function-declaration -Werror=implicit-int \ - -Werror=return-type -Wno-format-security \ -- -std=gnu89 -+ -std=gnu11 - KBUILD_CPPFLAGS := -D__KERNEL__ - KBUILD_AFLAGS_KERNEL := - KBUILD_CFLAGS_KERNEL := -@@ -809,7 +809,7 @@ KBUILD_CFLAGS += $(KBUILD_CFLAGS-y) - - ifdef CONFIG_CC_IS_CLANG - KBUILD_CPPFLAGS += -Qunused-arguments --# The kernel builds with '-std=gnu89' so use of GNU extensions is acceptable. -+# The kernel builds with '-std=gnu11' so use of GNU extensions is acceptable. - KBUILD_CFLAGS += -Wno-gnu - # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the - # source of a reference will be _MergedGlobals and not on of the whitelisted names. -diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile -index 50cb1ec092ae5..d7f5b140a5d2a 100644 ---- a/arch/arm64/kernel/vdso32/Makefile -+++ b/arch/arm64/kernel/vdso32/Makefile -@@ -77,7 +77,7 @@ VDSO_CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ - -Werror-implicit-function-declaration \ - -Wno-format-security \ - -Wdeclaration-after-statement \ -- -std=gnu89 -+ -std=gnu11 - VDSO_CFLAGS += -O2 - # Some useful compiler-dependent flags from top-level Makefile - VDSO_CFLAGS += $(call cc32-option,-Wdeclaration-after-statement,) --- -2.42.0 - diff --git a/queue-5.15/kbuild-use-wdeclaration-after-statement.patch b/queue-5.15/kbuild-use-wdeclaration-after-statement.patch deleted file mode 100644 index 2086106a2e8..00000000000 --- a/queue-5.15/kbuild-use-wdeclaration-after-statement.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 49ab1d1dd523ae5f59cdb5ae94d437a25c7f8933 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 8 Mar 2022 22:56:13 +0100 -Subject: Kbuild: use -Wdeclaration-after-statement -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Mark Rutland - -[ Upstream commit 4d94f910e79a349b00a4f8aab6f3ae87129d8c5a ] - -The kernel is moving from using `-std=gnu89` to `-std=gnu11`, permitting -the use of additional C11 features such as for-loop initial declarations. - -One contentious aspect of C99 is that it permits mixed declarations and -code, and for now at least, it seems preferable to enforce that -declarations must come first. - -These warnings were already enabled in the kernel itself, but not -for KBUILD_USERCFLAGS or the compat VDSO on arch/arm64, which uses -a separate set of CFLAGS. - -This patch fixes an existing violation in modpost.c, which is not -reported because of the missing flag in KBUILD_USERCFLAGS: - -| scripts/mod/modpost.c: In function ‘match’: -| scripts/mod/modpost.c:837:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] -| 837 | const char *endp = p + strlen(p) - 1; -| | ^~~~~ - -Signed-off-by: Mark Rutland -[arnd: don't add a duplicate flag to the default set, update changelog] -Signed-off-by: Arnd Bergmann -Reviewed-by: Nathan Chancellor -Reviewed-by: Nick Desaulniers -Tested-by: Sedat Dilek # LLVM/Clang v13.0.0 (x86-64) -Signed-off-by: Masahiro Yamada -Stable-dep-of: e8c07082a810 ("Kbuild: move to -std=gnu11") -Signed-off-by: Sasha Levin ---- - Makefile | 3 ++- - arch/arm64/kernel/vdso32/Makefile | 1 + - scripts/mod/modpost.c | 4 +++- - 3 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/Makefile b/Makefile -index 678e712591f89..5976e71522607 100644 ---- a/Makefile -+++ b/Makefile -@@ -440,7 +440,8 @@ endif - HOSTPKG_CONFIG = pkg-config - - export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \ -- -O2 -fomit-frame-pointer -std=gnu89 -+ -O2 -fomit-frame-pointer -std=gnu89 \ -+ -Wdeclaration-after-statement - export KBUILD_USERLDFLAGS := - - KBUILD_HOSTCFLAGS := $(KBUILD_USERCFLAGS) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS) -diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile -index 83e9399e38368..50cb1ec092ae5 100644 ---- a/arch/arm64/kernel/vdso32/Makefile -+++ b/arch/arm64/kernel/vdso32/Makefile -@@ -76,6 +76,7 @@ VDSO_CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ - -fno-strict-aliasing -fno-common \ - -Werror-implicit-function-declaration \ - -Wno-format-security \ -+ -Wdeclaration-after-statement \ - -std=gnu89 - VDSO_CFLAGS += -O2 - # Some useful compiler-dependent flags from top-level Makefile -diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c -index c6e655e0ed988..945f9ecb34079 100644 ---- a/scripts/mod/modpost.c -+++ b/scripts/mod/modpost.c -@@ -833,8 +833,10 @@ static int match(const char *sym, const char * const pat[]) - { - const char *p; - while (*pat) { -+ const char *endp; -+ - p = *pat++; -- const char *endp = p + strlen(p) - 1; -+ endp = p + strlen(p) - 1; - - /* "*foo*" */ - if (*p == '*' && *endp == '*') { --- -2.42.0 - diff --git a/queue-5.15/platform-x86-wmi-allow-duplicate-guids-for-drivers-t.patch b/queue-5.15/platform-x86-wmi-allow-duplicate-guids-for-drivers-t.patch index ffc2636b46d..7bf08c65b88 100644 --- a/queue-5.15/platform-x86-wmi-allow-duplicate-guids-for-drivers-t.patch +++ b/queue-5.15/platform-x86-wmi-allow-duplicate-guids-for-drivers-t.patch @@ -29,14 +29,12 @@ Signed-off-by: Hans de Goede Stable-dep-of: cbf54f37600e ("platform/x86: wmi: Skip blocks with zero instances") Signed-off-by: Sasha Levin --- - drivers/platform/x86/wmi.c | 49 +++++++++++++++++++++++++++++++------- - 1 file changed, 40 insertions(+), 9 deletions(-) + drivers/platform/x86/wmi.c | 51 +++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 42 insertions(+), 9 deletions(-) -diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c -index 63265ab964245..ce3380f09a472 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c -@@ -99,6 +99,12 @@ static const struct acpi_device_id wmi_device_ids[] = { +@@ -99,6 +99,12 @@ static const struct acpi_device_id wmi_d }; MODULE_DEVICE_TABLE(acpi, wmi_device_ids); @@ -49,7 +47,7 @@ index 63265ab964245..ce3380f09a472 100644 static struct platform_driver acpi_wmi_driver = { .driver = { .name = "acpi-wmi", -@@ -1039,6 +1045,23 @@ static const struct device_type wmi_type_data = { +@@ -1039,6 +1045,23 @@ static const struct device_type wmi_type .release = wmi_dev_release, }; @@ -73,7 +71,7 @@ index 63265ab964245..ce3380f09a472 100644 static int wmi_create_device(struct device *wmi_bus_dev, struct wmi_block *wblock, struct acpi_device *device) -@@ -1046,6 +1069,7 @@ static int wmi_create_device(struct device *wmi_bus_dev, +@@ -1046,6 +1069,7 @@ static int wmi_create_device(struct devi struct acpi_device_info *info; char method[5]; int result; @@ -81,7 +79,7 @@ index 63265ab964245..ce3380f09a472 100644 if (wblock->gblock.flags & ACPI_WMI_EVENT) { wblock->dev.dev.type = &wmi_type_event; -@@ -1102,7 +1126,11 @@ static int wmi_create_device(struct device *wmi_bus_dev, +@@ -1102,7 +1126,11 @@ static int wmi_create_device(struct devi wblock->dev.dev.bus = &wmi_bus_type; wblock->dev.dev.parent = wmi_bus_dev; @@ -94,7 +92,7 @@ index 63265ab964245..ce3380f09a472 100644 device_initialize(&wblock->dev.dev); -@@ -1122,11 +1150,20 @@ static void wmi_free_devices(struct acpi_device *device) +@@ -1122,11 +1150,22 @@ static void wmi_free_devices(struct acpi } } @@ -104,8 +102,10 @@ index 63265ab964245..ce3380f09a472 100644 struct wmi_block *wblock; list_for_each_entry(wblock, &wmi_block_list, list) { ++ int i; ++ + /* skip warning and register if we know the driver will use struct wmi_driver */ -+ for (int i = 0; allow_duplicates[i] != NULL; i++) { ++ for (i = 0; allow_duplicates[i] != NULL; i++) { + guid_t tmp; + + if (guid_parse(allow_duplicates[i], &tmp)) @@ -116,7 +116,7 @@ index 63265ab964245..ce3380f09a472 100644 if (guid_equal(&wblock->gblock.guid, guid)) { /* * Because we historically didn't track the relationship -@@ -1176,13 +1213,7 @@ static int parse_wdg(struct device *wmi_bus_dev, struct acpi_device *device) +@@ -1176,13 +1215,7 @@ static int parse_wdg(struct device *wmi_ if (debug_dump_wdg) wmi_dump_wdg(&gblock[i]); @@ -131,6 +131,3 @@ index 63265ab964245..ce3380f09a472 100644 continue; wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL); --- -2.42.0 - diff --git a/queue-5.15/platform-x86-wmi-skip-blocks-with-zero-instances.patch b/queue-5.15/platform-x86-wmi-skip-blocks-with-zero-instances.patch index 9798f6463f2..1964187dc1d 100644 --- a/queue-5.15/platform-x86-wmi-skip-blocks-with-zero-instances.patch +++ b/queue-5.15/platform-x86-wmi-skip-blocks-with-zero-instances.patch @@ -25,14 +25,12 @@ Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen Signed-off-by: Sasha Levin --- - drivers/platform/x86/wmi.c | 5 +++++ + drivers/platform/x86/wmi.c | 5 +++++ 1 file changed, 5 insertions(+) -diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c -index ce3380f09a472..7bb849aaa99e1 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c -@@ -1213,6 +1213,11 @@ static int parse_wdg(struct device *wmi_bus_dev, struct acpi_device *device) +@@ -1215,6 +1215,11 @@ static int parse_wdg(struct device *wmi_ if (debug_dump_wdg) wmi_dump_wdg(&gblock[i]); @@ -44,6 +42,3 @@ index ce3380f09a472..7bb849aaa99e1 100644 if (guid_already_parsed_for_legacy(device, &gblock[i].guid)) continue; --- -2.42.0 - diff --git a/queue-5.15/series b/queue-5.15/series index a3d8bb4f60f..9c69e62bf8b 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -118,8 +118,6 @@ perf-fix-perf_event_validate_size.patch gpiolib-sysfs-fix-error-handling-on-failed-export.patch drm-amd-amdgpu-fix-warnings-in-amdgpu-amdgpu_display.patch drm-amdgpu-correct-the-amdgpu-runtime-dereference-us.patch -kbuild-use-wdeclaration-after-statement.patch -kbuild-move-to-std-gnu11.patch usb-gadget-f_hid-fix-report-descriptor-allocation.patch parport-add-support-for-brainboxes-ix-uc-px-parallel-cards.patch revert-xhci-loosen-rpm-as-default-policy-to-cover-for-amd-xhc-1.1.patch