drivers/platform/x86/msi-ec.c:825:35: warning: 'msi_dmi_table' defined but not used
Subsystems (2)
kernel test robot
build bottree: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git review-hans head: 9a62a9be30c2caab402c66105171cd96bbfd077d commit: 9a62a9be30c2caab402c66105171cd96bbfd077d [82/82] platform/x86: Add new msi-ec driver config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20230327/[email protected]/config) compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/?id=9a62a9be30c2caab402c66105171cd96bbfd077d
git remote add pdx86-platform-drivers-x86 https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git
git fetch --no-tags pdx86-platform-drivers-x86 review-hans
git checkout 9a62a9be30c2caab402c66105171cd96bbfd077d
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/platform/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/platform/x86/msi-ec.c:825:35: warning: 'msi_dmi_table' defined but not used [-Wunused-const-variable=]
825 | static const struct dmi_system_id msi_dmi_table[] __initconst = {
| ^~~~~~~~~~~~~vim +/msi_dmi_table +825 drivers/platform/x86/msi-ec.c
820
821 /*
822 * Module load/unload
823 */
824
> 825 static const struct dmi_system_id msi_dmi_table[] __initconst = { 826 {
827 .matches = {
828 DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INT"),
829 },
830 },
831 {
832 .matches = {
833 DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"),
834 },
835 },
836 {
837 .matches = {
838 DMI_MATCH(DMI_SYS_VENDOR,
839 "Micro-Star International Co., Ltd."),
840 },
841 },
842 {
843 .matches = {
844 DMI_MATCH(DMI_SYS_VENDOR,
845 "MICRO-STAR INTERNATIONAL CO., LTD"),
846 },
847 },
848 {}
849 };
850 MODULE_DEVICE_TABLE(dmi, msi_dmi_table);
851
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests
Hi,
Quoted 19 lines · kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git review-hans head: 9a62a9be30c2caab402c66105171cd96bbfd077d commit: 9a62a9be30c2caab402c66105171cd96bbfd077d [82/82] platform/x86: Add new msi-ec driver config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20230327/[email protected]/config) compiler: gcc-11 (Debian 11.3.0-8) 11.3.0reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/?id=9a62a9be30c2caab402c66105171cd96bbfd077d
git remote add pdx86-platform-drivers-x86 https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git
git fetch --no-tags pdx86-platform-drivers-x86 review-hans
git checkout9a62a9be30c2caab402c66105171cd96bbfd077d
# save the config file
mkdirbuild_dir&& cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bashdrivers/platform/If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Quoted 8 lines
All warnings (new ones prefixed by >>):
Quoted 1 line
Quoted 1 line
drivers/platform/x86/msi-ec.c:825:35: warning: 'msi_dmi_table' defined but not used [-Wunused-const-variable=]825 | static const struct dmi_system_id msi_dmi_table[] __initconst = { | ^~~~~~~~~~~~~vim +/msi_dmi_table +825
drivers/platform/x86/msi-ec.c
Ah yes, since this is only used for module-autoloading and not used otherwise in the driver, it is unused when the driver gets builtin, so it should be marked __maybe_unused.
Nikita, while fixing this I also noticed that you match on e.g. both "MICRO-STAR INT" and "MICRO-STAR INTERNATIONAL CO., LTD" but DMI_MATCH does substring matching so since "MICRO-STAR INT" is a substring of "MICRO-STAR INTERNATIONAL CO., LTD" there is no need to check for the latter since "MICRO-STAR INT" will already match this.
So to fix both issues I have squashed the following fix into the original commit:
drivers/platform/x86/msi-ec.c +1 -13
@@ -822,7 +822,7 @@ static struct acpi_battery_hook battery_hook = {* Module load/unload */ -static const struct dmi_system_id msi_dmi_table[]__initconst = { +static const struct dmi_system_id msi_dmi_table[]__initconst __maybe_unused = { { .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"MICRO-STAR INT" ),
@@ -833,18 +833,6 @@ static const struct dmi_system_id msi_dmi_table[] __initconst = { DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"), }, }, - { - .matches = { -DMI_MATCH (DMI_SYS_VENDOR , - "Micro-Star International Co., Ltd."), - }, - }, - { - .matches = { -DMI_MATCH (DMI_SYS_VENDOR , - "MICRO-STAR INTERNATIONAL CO., LTD"), - }, - }, {} };MODULE_DEVICE_TABLE (dmi, msi_dmi_table);
Regards,
Hans
Quoted 34 lines
820 821 /* 822 * Module load/unload 823 */ 824Quoted 1 line
825 static const struct
dmi_system_idmsi_dmi_table[]__initconst= {826 { 827 .matches = { 828 DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INT"), 829 }, 830 }, 831 { 832 .matches = { 833 DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"), 834 }, 835 }, 836 { 837 .matches = { 838 DMI_MATCH(DMI_SYS_VENDOR, 839 "Micro-Star International Co., Ltd."), 840 }, 841 }, 842 { 843 .matches = { 844 DMI_MATCH(DMI_SYS_VENDOR, 845 "MICRO-STAR INTERNATIONAL CO., LTD"), 846 }, 847 }, 848 {} 849 }; 850 MODULE_DEVICE_TABLE(dmi, msi_dmi_table); 851