2024-04-03 08:19:37

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 15/34] leds: apu: remove duplicate DMI lookup data

From: Arnd Bergmann <[email protected]>

Building with W=1 shows a warning about an unused dmi_system_id table:

drivers/leds/leds-apu.c:85:35: error: 'apu_led_dmi_table' defined but not used [-Werror=unused-const-variable=]
85 | static const struct dmi_system_id apu_led_dmi_table[] __initconst = {

Since the current version doesn't even do anything about the different
implementations but only checks the type of system, just drop the
custom lookup logic and call dmi_check_system() using the table itself.

Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/leds/leds-apu.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/leds/leds-apu.c b/drivers/leds/leds-apu.c
index c409b80c236d..1c116aaa9b6e 100644
--- a/drivers/leds/leds-apu.c
+++ b/drivers/leds/leds-apu.c
@@ -181,8 +181,7 @@ static int __init apu_led_init(void)
struct platform_device *pdev;
int err;

- if (!(dmi_match(DMI_SYS_VENDOR, "PC Engines") &&
- (dmi_match(DMI_PRODUCT_NAME, "APU") || dmi_match(DMI_PRODUCT_NAME, "apu1")))) {
+ if (!dmi_check_system(apu_led_dmi_table)) {
pr_err("No PC Engines APUv1 board detected. For APUv2,3 support, enable CONFIG_PCENGINES_APU2\n");
return -ENODEV;
}
--
2.39.2



2024-04-11 17:23:59

by Lee Jones

[permalink] [raw]
Subject: Re: (subset) [PATCH 15/34] leds: apu: remove duplicate DMI lookup data

On Wed, 03 Apr 2024 10:06:33 +0200, Arnd Bergmann wrote:
> Building with W=1 shows a warning about an unused dmi_system_id table:
>
> drivers/leds/leds-apu.c:85:35: error: 'apu_led_dmi_table' defined but not used [-Werror=unused-const-variable=]
> 85 | static const struct dmi_system_id apu_led_dmi_table[] __initconst = {
>
> Since the current version doesn't even do anything about the different
> implementations but only checks the type of system, just drop the
> custom lookup logic and call dmi_check_system() using the table itself.
>
> [...]

Applied, thanks!

[15/34] leds: apu: remove duplicate DMI lookup data
commit: 6e37e66058d9c0bfa13d32e2c6ff14439d5e62f9

--
Lee Jones [李琼斯]