jump_label: Fix sparc64 warning

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Mar 19 02:59:09 PDT 2018


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=af1d830bf32b27b387b97c8b29dc09e306a9ff7f
Commit:     af1d830bf32b27b387b97c8b29dc09e306a9ff7f
Parent:     a14bff131108faf50cc0cf864589fd71ee216c96
Author:     Josh Poimboeuf <jpoimboe at redhat.com>
AuthorDate: Wed Mar 14 10:24:20 2018 -0500
Committer:  Thomas Gleixner <tglx at linutronix.de>
CommitDate: Wed Mar 14 16:35:26 2018 +0100

    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 at intel.com>
    Signed-off-by: Josh Poimboeuf <jpoimboe at redhat.com>
    Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
    Cc: Peter Zijlstra <peterz at infradead.org>
    Cc: Jason Baron <jbaron at akamai.com>
    Cc: Borislav Petkov <bp at suse.de>
    Cc: "David S . Miller" <davem at davemloft.net>
    Link: https://lkml.kernel.org/r/c966fed42be6611254a62d46579ec7416548d572.1521041026.git.jpoimboe@redhat.com
---
 kernel/jump_label.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/jump_label.c b/kernel/jump_label.c
index 52a0a7af8640..e7214093dcd1 100644
--- a/kernel/jump_label.c
+++ b/kernel/jump_label.c
@@ -373,7 +373,8 @@ static void __jump_label_update(struct static_key *key,
 			if (kernel_text_address(entry->code))
 				arch_jump_label_transform(entry, jump_label_type(entry));
 			else
-				WARN_ONCE(1, "can't patch jump_label at %pS", (void *)entry->code);
+				WARN_ONCE(1, "can't patch jump_label at %pS",
+					  (void *)(unsigned long)entry->code);
 		}
 	}
 }



More information about the linux-mtd-cvs mailing list