Skip to content

Commit 40ba930

Browse files
Vamshi K Sthambamkadisuryasaimadhu
authored andcommitted
x86/boot: Fix -Wint-to-pointer-cast build warning
Fix this warning when building 32-bit with CONFIG_RANDOMIZE_BASE=y CONFIG_MEMORY_HOTREMOVE=y arch/x86/boot/compressed/acpi.c:316:9: warning: \ cast to pointer from integer of different size [-Wint-to-pointer-cast] Have get_cmdline_acpi_rsdp() return unsigned long which is the proper type to convert to a pointer of the respective width. [ bp: Rewrite commit message, touch ups. ] Signed-off-by: Vamshi K Sthambamkadi <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 5fafbeb commit 40ba930

File tree

1 file changed

+3
-4
lines changed
  • arch/x86/boot/compressed

1 file changed

+3
-4
lines changed

arch/x86/boot/compressed/acpi.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,9 @@ acpi_physical_address get_rsdp_addr(void)
280280
*/
281281
#define MAX_ADDR_LEN 19
282282

283-
static acpi_physical_address get_cmdline_acpi_rsdp(void)
283+
static unsigned long get_cmdline_acpi_rsdp(void)
284284
{
285-
acpi_physical_address addr = 0;
285+
unsigned long addr = 0;
286286

287287
#ifdef CONFIG_KEXEC
288288
char val[MAX_ADDR_LEN] = { };
@@ -292,7 +292,7 @@ static acpi_physical_address get_cmdline_acpi_rsdp(void)
292292
if (ret < 0)
293293
return 0;
294294

295-
if (kstrtoull(val, 16, &addr))
295+
if (boot_kstrtoul(val, 16, &addr))
296296
return 0;
297297
#endif
298298
return addr;
@@ -314,7 +314,6 @@ static unsigned long get_acpi_srat_table(void)
314314
* different ideas about whether to trust a command-line parameter.
315315
*/
316316
rsdp = (struct acpi_table_rsdp *)get_cmdline_acpi_rsdp();
317-
318317
if (!rsdp)
319318
rsdp = (struct acpi_table_rsdp *)(long)
320319
boot_params->acpi_rsdp_addr;

0 commit comments

Comments
 (0)