Skip to content

Commit 457d2fc

Browse files
MQ-mengqingtsbogend
authored andcommitted
MIPS: relocatable: Use __kaslr_offset in show_kernel_relocation
The type of the VMLINUX_LOAD_ADDRESS macro is the (unsigned long long) in 32bits kernel but (unsigned long) in the 64-bit kernel. Although there is no error here, avoid using it to calculate kaslr_offset. Signed-off-by: Jinyang He <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent d4d3ef8 commit 457d2fc

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

arch/mips/kernel/relocate.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,13 +430,9 @@ void *__init relocate_kernel(void)
430430
*/
431431
static void show_kernel_relocation(const char *level)
432432
{
433-
unsigned long offset;
434-
435-
offset = __pa_symbol(_text) - __pa_symbol(VMLINUX_LOAD_ADDRESS);
436-
437-
if (IS_ENABLED(CONFIG_RELOCATABLE) && offset > 0) {
433+
if (__kaslr_offset > 0) {
438434
printk(level);
439-
pr_cont("Kernel relocated by 0x%pK\n", (void *)offset);
435+
pr_cont("Kernel relocated by 0x%pK\n", (void *)__kaslr_offset);
440436
pr_cont(" .text @ 0x%pK\n", _text);
441437
pr_cont(" .data @ 0x%pK\n", _sdata);
442438
pr_cont(" .bss @ 0x%pK\n", __bss_start);

0 commit comments

Comments
 (0)