Linux EDAC development
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, Yazen Ghannam <yazen.ghannam@amd.com>,
	Xunlei Pang <xlpang@redhat.com>,
	linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: x86: mce: fix type mismatch warning
Date: Wed, 10 Jan 2018 17:45:54 +0100	[thread overview]
Message-ID: <20180110164616.1465096-1-arnd@arndb.de> (raw)

The printed symbol is a 64-bit address, so we get a warning when
building this code for 32-bit kernels:

arch/x86/kernel/cpu/mcheck/mce.c: In function '__print_mce':
arch/x86/kernel/cpu/mcheck/mce.c:237:21: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

This uses an extra uintptr_t cast to avoid the warning.

Fixes: 7b6061627eb8 ("x86: do not use print_symbol()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/x86/kernel/cpu/mcheck/mce.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 26ee8c4c9b18..3b2f86c51a98 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -234,7 +234,7 @@ static void __print_mce(struct mce *m)
 			m->cs, m->ip);
 
 		if (m->cs == __KERNEL_CS)
-			pr_cont("{%pS}", (void *)m->ip);
+			pr_cont("{%pS}", (void *)(uintptr_t)m->ip);
 		pr_cont("\n");
 	}
 

             reply	other threads:[~2018-01-10 16:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10 16:45 Arnd Bergmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-01-14 11:52 x86: mce: fix type mismatch warning Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180110164616.1465096-1-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=xlpang@redhat.com \
    --cc=yazen.ghannam@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox