Skip to content

Commit af1d830

Browse files
jpoimboeKAGA-KOKO
authored andcommitted
jump_label: Fix sparc64 warning
The kbuild test robot reported the following warning on sparc64: kernel/jump_label.c: In function '__jump_label_update': kernel/jump_label.c:376:51: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] WARN_ONCE(1, "can't patch jump_label at %pS", (void *)entry->code); On sparc64, the jump_label entry->code field is of type u32, but pointers are 64-bit. Silence the warning by casting entry->code to an unsigned long before casting it to a pointer. This is also what the sparc jump label code does. Fixes: dc1dd18 ("jump_label: Warn on failed jump_label patching attempt") Reported-by: kbuild test robot <[email protected]> Signed-off-by: Josh Poimboeuf <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Jason Baron <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: "David S . Miller" <[email protected]> Link: https://lkml.kernel.org/r/c966fed42be6611254a62d46579ec7416548d572.1521041026.git.jpoimboe@redhat.com
1 parent a14bff1 commit af1d830

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/jump_label.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@ static void __jump_label_update(struct static_key *key,
373373
if (kernel_text_address(entry->code))
374374
arch_jump_label_transform(entry, jump_label_type(entry));
375375
else
376-
WARN_ONCE(1, "can't patch jump_label at %pS", (void *)entry->code);
376+
WARN_ONCE(1, "can't patch jump_label at %pS",
377+
(void *)(unsigned long)entry->code);
377378
}
378379
}
379380
}

0 commit comments

Comments
 (0)