Commit 05a476b6 authored by Alexander Duyck's avatar Alexander Duyck Committed by H. Peter Anvin

x86: Drop 4 unnecessary calls to __pa_symbol

While debugging the __pa_symbol inline patch I found that there were a couple
spots where __pa_symbol was used as follows:
__pa_symbol(x) - __pa_symbol(y)

The compiler had reduced them to:
x - y

Since we also support a debug case where __pa_symbol is a function call it
would probably be useful to just change the two cases I found so that they are
always just treated as "x - y".  As such I am casting the values to
phys_addr_t and then doing simple subtraction so that the correct type and
value is returned.
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Link: http://lkml.kernel.org/r/20121116215552.8521.68085.stgit@ahduyck-cp1.jf.intel.comSigned-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent 7d74275d
......@@ -30,8 +30,8 @@ static void __init i386_default_early_setup(void)
void __init i386_start_kernel(void)
{
memblock_reserve(__pa_symbol(&_text),
__pa_symbol(&__bss_stop) - __pa_symbol(&_text));
memblock_reserve(__pa_symbol(_text),
(phys_addr_t)__bss_stop - (phys_addr_t)_text);
#ifdef CONFIG_BLK_DEV_INITRD
/* Reserve INITRD */
......
......@@ -97,8 +97,8 @@ void __init x86_64_start_reservations(char *real_mode_data)
{
copy_bootdata(__va(real_mode_data));
memblock_reserve(__pa_symbol(&_text),
__pa_symbol(&__bss_stop) - __pa_symbol(&_text));
memblock_reserve(__pa_symbol(_text),
(phys_addr_t)__bss_stop - (phys_addr_t)_text);
#ifdef CONFIG_BLK_DEV_INITRD
/* Reserve INITRD */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment