]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: google: fix unused variable warning under !CONFIG_ACPI
authorYu-Chun Lin <eleanor15x@gmail.com>
Mon, 17 Feb 2025 16:50:13 +0000 (00:50 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:51:04 +0000 (12:51 +0100)
commit4283afde4f8dcfb9cc6bd08d1746f5c24838e485
treea64cf754605310a6bf0cebe3049ea13450f919c7
parent47616b82f2d42ea2060334746fed9a2988d845c9
HID: google: fix unused variable warning under !CONFIG_ACPI

[ Upstream commit 4bd0725c09f377ffaf22b834241f6c050742e4fc ]

As reported by the kernel test robot, the following warning occurs:

>> drivers/hid/hid-google-hammer.c:261:36: warning: 'cbas_ec_acpi_ids' defined but not used [-Wunused-const-variable=]
     261 | static const struct acpi_device_id cbas_ec_acpi_ids[] = {
         |                                    ^~~~~~~~~~~~~~~~

The 'cbas_ec_acpi_ids' array is only used when CONFIG_ACPI is enabled.
Wrapping its definition and 'MODULE_DEVICE_TABLE' in '#ifdef CONFIG_ACPI'
prevents a compiler warning when ACPI is disabled.

Fixes: eb1aac4c8744f75 ("HID: google: add support tablet mode switch for Whiskers")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501201141.jctFH5eB-lkp@intel.com/
Signed-off-by: Yu-Chun Lin <eleanor15x@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-google-hammer.c