Skip to content

Commit 228d120

Browse files
Zhenzhong DuanKAGA-KOKO
authored andcommitted
x86/boot/acpi: Move get_cmdline_acpi_rsdp() under #ifdef guard
When building with "EXTRA_CFLAGS=-Wall" gcc warns: arch/x86/boot/compressed/acpi.c:29:30: warning: get_cmdline_acpi_rsdp defined but not used [-Wunused-function] get_cmdline_acpi_rsdp() is only used when CONFIG_RANDOMIZE_BASE and CONFIG_MEMORY_HOTREMOVE are both enabled, so any build where one of these config options is disabled has this issue. Move the function under the same ifdef guard as the call site. [ tglx: Add context to the changelog so it becomes useful ] Fixes: 41fa1ee ("acpi: Ignore acpi_rsdp kernel param when the kernel has been locked down") Signed-off-by: Zhenzhong Duan <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent f7c0f50 commit 228d120

File tree

1 file changed

+24
-24
lines changed
  • arch/x86/boot/compressed

1 file changed

+24
-24
lines changed

arch/x86/boot/compressed/acpi.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,6 @@
2020
*/
2121
struct mem_vector immovable_mem[MAX_NUMNODES*2];
2222

23-
/*
24-
* Max length of 64-bit hex address string is 19, prefix "0x" + 16 hex
25-
* digits, and '\0' for termination.
26-
*/
27-
#define MAX_ADDR_LEN 19
28-
29-
static acpi_physical_address get_cmdline_acpi_rsdp(void)
30-
{
31-
acpi_physical_address addr = 0;
32-
33-
#ifdef CONFIG_KEXEC
34-
char val[MAX_ADDR_LEN] = { };
35-
int ret;
36-
37-
ret = cmdline_find_option("acpi_rsdp", val, MAX_ADDR_LEN);
38-
if (ret < 0)
39-
return 0;
40-
41-
if (kstrtoull(val, 16, &addr))
42-
return 0;
43-
#endif
44-
return addr;
45-
}
46-
4723
/*
4824
* Search EFI system tables for RSDP. If both ACPI_20_TABLE_GUID and
4925
* ACPI_TABLE_GUID are found, take the former, which has more features.
@@ -298,6 +274,30 @@ acpi_physical_address get_rsdp_addr(void)
298274
}
299275

300276
#if defined(CONFIG_RANDOMIZE_BASE) && defined(CONFIG_MEMORY_HOTREMOVE)
277+
/*
278+
* Max length of 64-bit hex address string is 19, prefix "0x" + 16 hex
279+
* digits, and '\0' for termination.
280+
*/
281+
#define MAX_ADDR_LEN 19
282+
283+
static acpi_physical_address get_cmdline_acpi_rsdp(void)
284+
{
285+
acpi_physical_address addr = 0;
286+
287+
#ifdef CONFIG_KEXEC
288+
char val[MAX_ADDR_LEN] = { };
289+
int ret;
290+
291+
ret = cmdline_find_option("acpi_rsdp", val, MAX_ADDR_LEN);
292+
if (ret < 0)
293+
return 0;
294+
295+
if (kstrtoull(val, 16, &addr))
296+
return 0;
297+
#endif
298+
return addr;
299+
}
300+
301301
/* Compute SRAT address from RSDP. */
302302
static unsigned long get_acpi_srat_table(void)
303303
{

0 commit comments

Comments
 (0)