From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <1355425027.13796.31.camel@joe-AO722> From: Joe Perches Date: Thu, 13 Dec 2012 10:57:07 -0800 In-Reply-To: <20121213183659.GC31485@liondog.tnic> References: <054f8a88fe46ae0b4c2669d0e155d84c11b66115.1355335228.git.joe@perches.com> <20121212210959.GH8760@liondog.tnic> <1355347803.8538.16.camel@joe-AO722> <3908561D78D1C84285E8C5FCA982C28F1C969495@ORSMSX108.amr.corp.intel.com> <1355351039.27571.2.camel@joe-AO722> <20121212224550.GJ8760@liondog.tnic> <1355422990.13796.9.camel@joe-AO722> <20121213183659.GC31485@liondog.tnic> Content-Type: text/plain; charset=UTF-8 Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Sender: linux-kernel-owner@vger.kernel.org Subject: Re: [TRIVIAL PATCH 16/26] x86: Convert print_symbol to %pSR To: Borislav Petkov Cc: "Luck, Tony" , Jiri Kosina , Jeff Dike , Richard Weinberger , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "x86@kernel.org" , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "user-mode-linux-devel@lists.sourceforge.net" , "user-mode-linux-user@lists.sourceforge.net" List-ID: On Thu, 2012-12-13 at 19:37 +0100, Borislav Petkov wrote: > On Thu, Dec 13, 2012 at 10:23:10AM -0800, Joe Perches wrote: > > m->ip is a u64 so, when compiling x86-32, there's a new warning > > "cast to pointer from integer of different size". This isn't new > > different behavior, just a new warning. The previous print_symbol > > took a ulong and the u64 was silently truncated. > >=20 > > CC arch/x86/kernel/cpu/mcheck/mce.o > > arch/x86/kernel/cpu/mcheck/mce.c: In function =E2=80=98print_mce=E2= =80=99: > > arch/x86/kernel/cpu/mcheck/mce.c:246:4: warning: cast to pointer fr= om integer of different size [-Wint-to-pointer-cast] > >=20 > > If appropriate, the code could be changed to > >=20 > > (void *)(unsigned long)m->ip >=20 > Can we explicitly cast it to what it is so that we can be explicit as= to > what we're casting it? IOW: >=20 > (void *)(__u64)m->ip; >=20 > Does that even work on 32bit? No, it already is __u64. You need (unsigned long) or something else the same size as (void *) from: arch/x86/include/asm/mce.h /* Fields are zero when not available */ struct mce { =2E.. __u64 ip; > Also, does the compiler bitch about this useless cast when building w= ith > W=3D123? =46or x86-32: With the cast the line is silent. Without the cast, just the warning about cast. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel"= in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/