Skip to content

Commit 4bd0725

Browse files
eleanorLYJJiri Kosina
authored andcommitted
HID: google: fix unused variable warning under !CONFIG_ACPI
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: eb1aac4 ("HID: google: add support tablet mode switch for Whiskers") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Yu-Chun Lin <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 44afc10 commit 4bd0725

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/hid/hid-google-hammer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,13 @@ static void cbas_ec_remove(struct platform_device *pdev)
268268
mutex_unlock(&cbas_ec_reglock);
269269
}
270270

271+
#ifdef CONFIG_ACPI
271272
static const struct acpi_device_id cbas_ec_acpi_ids[] = {
272273
{ "GOOG000B", 0 },
273274
{ }
274275
};
275276
MODULE_DEVICE_TABLE(acpi, cbas_ec_acpi_ids);
277+
#endif
276278

277279
#ifdef CONFIG_OF
278280
static const struct of_device_id cbas_ec_of_match[] = {

0 commit comments

Comments
 (0)