Skip to content

Commit

Permalink
ACPI: blacklist: fix clang warning for unused DMI table
Browse files Browse the repository at this point in the history
[ Upstream commit b80d6a42bdc97bdb6139107d6034222e9843c6e2 ]

When CONFIG_DMI is disabled, we only have a tentative declaration,
which causes a warning from clang:

drivers/acpi/blacklist.c:20:35: error: tentative array definition assumed to have one element [-Werror]
static const struct dmi_system_id acpi_rev_dmi_table[] __initconst;

As the variable is not actually used here, hide it entirely
in an #ifdef to shut up the warning.

Signed-off-by: Arnd Bergmann <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
arndb authored and gregkh committed Aug 6, 2019
1 parent c47e255 commit d556876
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/acpi/blacklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@

#include "internal.h"

#ifdef CONFIG_DMI
static const struct dmi_system_id acpi_rev_dmi_table[] __initconst;
#endif

/*
* POLICY: If *anything* doesn't work, put it on the blacklist.
Expand Down Expand Up @@ -74,7 +76,9 @@ int __init acpi_blacklisted(void)
}

(void)early_acpi_osi_init();
#ifdef CONFIG_DMI
dmi_check_system(acpi_rev_dmi_table);
#endif

return blacklisted;
}
Expand Down

0 comments on commit d556876

Please sign in to comment.