Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: dc1dd184c2f0 ("jump_label: Warn on failed jump_label patching attempt")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Jason Baron <jbaron@akamai.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: "David S . Miller" <davem@davemloft.net>
Link: https://lkml.kernel.org/r/c966fed42be6611254a62d46579ec7416548d572.1521041026.git.jpoimboe@redhat.com

authored by

Josh Poimboeuf and committed by
Thomas Gleixner
af1d830b a14bff13

+2 -1
+2 -1
kernel/jump_label.c
··· 373 373 if (kernel_text_address(entry->code)) 374 374 arch_jump_label_transform(entry, jump_label_type(entry)); 375 375 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); 377 378 } 378 379 } 379 380 }