Skip to content

Commit

Permalink
staging: rtl8723bs: Mark ACPI table declaration as used
Browse files Browse the repository at this point in the history
Clang emits the following warning:

drivers/staging/rtl8723bs/os_dep/sdio_intf.c:25:36: warning: variable
'acpi_ids' is not needed and will not be emitted
[-Wunneeded-internal-declaration]
static const struct acpi_device_id acpi_ids[] = {
                                   ^
1 warning generated.

Mark acpi_ids with the attribute __used, which makes it clear to Clang
that we don't want this warning while not inhibiting Clang's dead code
elimination from removing the unreferenced internal symbol when moving
the data to the globally available symbol with MODULE_DEVICE_TABLE.

$ nm -S drivers/staging/rtl8723bs/os_dep/sdio_intf.o | grep acpi
0000000000000000 0000000000000040 R __mod_acpi__acpi_ids_device_table

Link: https://github.com/ClangBuiltLinux/linux/issues/169
Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Nathan Chancellor authored and Greg Kroah-Hartman committed Oct 2, 2018
1 parent 7b6e286 commit e6d0937
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/rtl8723bs/os_dep/sdio_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static const struct sdio_device_id sdio_ids[] =
{ SDIO_DEVICE(0x024c, 0xb723), },
{ /* end: all zeroes */ },
};
static const struct acpi_device_id acpi_ids[] = {
static const struct acpi_device_id acpi_ids[] __used = {
{"OBDA8723", 0x0000},
{}
};
Expand Down

0 comments on commit e6d0937

Please sign in to comment.