lkml.org 
[lkml]   [2020]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip: x86/boot] x86/boot: Fix -Wint-to-pointer-cast build warning
The following commit has been merged into the x86/boot branch of tip:

Commit-ID: 40ba9309c76f29d012a5cc0cf938f8ff7dc6fef2
Gitweb: https://git.kernel.org/tip/40ba9309c76f29d012a5cc0cf938f8ff7dc6fef2
Author: Vamshi K Sthambamkadi <vamshi.k.sthambamkadi@gmail.com>
AuthorDate: Thu, 23 Apr 2020 18:09:48 +05:30
Committer: Borislav Petkov <bp@suse.de>
CommitterDate: Mon, 04 May 2020 15:22:16 +02:00

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 <vamshi.k.sthambamkadi@gmail.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/1587645588-7130-3-git-send-email-vamshi.k.sthambamkadi@gmail.com
---
arch/x86/boot/compressed/acpi.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c
index ef2ad72..8bcbcee 100644
--- a/arch/x86/boot/compressed/acpi.c
+++ b/arch/x86/boot/compressed/acpi.c
@@ -280,9 +280,9 @@ acpi_physical_address get_rsdp_addr(void)
*/
#define MAX_ADDR_LEN 19

-static acpi_physical_address get_cmdline_acpi_rsdp(void)
+static unsigned long get_cmdline_acpi_rsdp(void)
{
- acpi_physical_address addr = 0;
+ unsigned long addr = 0;

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

- if (kstrtoull(val, 16, &addr))
+ if (boot_kstrtoul(val, 16, &addr))
return 0;
#endif
return addr;
@@ -314,7 +314,6 @@ static unsigned long get_acpi_srat_table(void)
* different ideas about whether to trust a command-line parameter.
*/
rsdp = (struct acpi_table_rsdp *)get_cmdline_acpi_rsdp();
-
if (!rsdp)
rsdp = (struct acpi_table_rsdp *)(long)
boot_params->acpi_rsdp_addr;
\
 
 \ /
  Last update: 2020-05-04 18:53    [W:0.040 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site