From 804cedfbd288d59eb59a97d1a1b48e86ee0899e3 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: May 08 2023 09:14:59 +0000 Subject: platform/x86: alienware-wmi: constify attribute_group structures (git-fixes). --- diff --git a/patches.suse/platform-x86-alienware-wmi-constify-attribute_group-.patch b/patches.suse/platform-x86-alienware-wmi-constify-attribute_group-.patch new file mode 100644 index 0000000..6f87c0f --- /dev/null +++ b/patches.suse/platform-x86-alienware-wmi-constify-attribute_group-.patch @@ -0,0 +1,62 @@ +From 4b7942d8d1ced3c82495953cb0bb90e7de6dbba6 Mon Sep 17 00:00:00 2001 +From: Arvind Yadav +Date: Tue, 11 Jul 2017 16:18:17 +0530 +Subject: [PATCH] platform/x86: alienware-wmi: constify attribute_group + structures. +Git-commit: 4b7942d8d1ced3c82495953cb0bb90e7de6dbba6 +References: git-fixes +Patch-mainline: v4.13-rc1 + +attribute_groups are not supposed to change at runtime. All functions +working with attribute_groups provided by work +with const attribute_group. So mark the non-const structs as const. + +File size before: + text data bss dec hex filename + 6932 1016 48 7996 1f3c drivers/platform/x86/alienware-wmi.o + +File size After adding 'const': + text data bss dec hex filename + 7060 888 48 7996 1f64 drivers/platform/x86/alienware-wmi.o + +Signed-off-by: Arvind Yadav +Signed-off-by: Darren Hart (VMware) +Signed-off-by: Oliver Neukum +--- + drivers/platform/x86/alienware-wmi.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/platform/x86/alienware-wmi.c b/drivers/platform/x86/alienware-wmi.c +index 9866fec78c1c..0831b428c217 100644 +--- a/drivers/platform/x86/alienware-wmi.c ++++ b/drivers/platform/x86/alienware-wmi.c +@@ -604,7 +604,7 @@ static struct attribute *hdmi_attrs[] = { + NULL, + }; + +-static struct attribute_group hdmi_attribute_group = { ++static const struct attribute_group hdmi_attribute_group = { + .name = "hdmi", + .attrs = hdmi_attrs, + }; +@@ -660,7 +660,7 @@ static struct attribute *amplifier_attrs[] = { + NULL, + }; + +-static struct attribute_group amplifier_attribute_group = { ++static const struct attribute_group amplifier_attribute_group = { + .name = "amplifier", + .attrs = amplifier_attrs, + }; +@@ -741,7 +741,7 @@ static struct attribute *deepsleep_attrs[] = { + NULL, + }; + +-static struct attribute_group deepsleep_attribute_group = { ++static const struct attribute_group deepsleep_attribute_group = { + .name = "deepsleep", + .attrs = deepsleep_attrs, + }; +-- +2.40.1 + diff --git a/series.conf b/series.conf index 764a71f..dbe8188 100644 --- a/series.conf +++ b/series.conf @@ -5504,6 +5504,7 @@ patches.suse/0017-rtc-Remove-wrong-deprecation-comment.patch patches.suse/platform-x86-ideapad-laptop-Add-IdeaPad-V510-15IKB-t patches.suse/platform-x86-ideapad-laptop-Add-several-models-to-no + patches.suse/platform-x86-alienware-wmi-constify-attribute_group-.patch patches.suse/platform-x86-asus-wmi-constify-attribute_group-struc.patch patches.suse/include-linux-dcache.h-use-unsigned-chars-in-struct-.patch patches.suse/kernel.h-handle-pointers-to-arrays-better-in-contain.patch