public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Andi Kleen <ak@suse.de>,
	mingo@elte.hu, tglx@linutronix.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [3/7] Use shorter addresses in i386 segfault printks
Date: Wed, 16 Jan 2008 22:11:58 -0500	[thread overview]
Message-ID: <478EC77E.8090103@zytor.com> (raw)
In-Reply-To: <1200538738.17967.4.camel@brick>

Harvey Harrison wrote:
> On Wed, 2008-01-16 at 23:27 +0100, Andi Kleen wrote:
>> Signed-off-by: Andi Kleen <ak@suse.de>
>>
>> ---
>>  arch/x86/mm/fault_32.c |    2 +-
> 
> Could use exactly the same in fault_64.c
> 
>>  #ifdef CONFIG_X86_32
>> -			"%s%s[%d]: segfault at %08lx ip %08lx sp %08lx error %lx\n",
>> +			"%s%s[%d]: segfault at %lx ip %08lx sp %08lx error %lx\n",
>>  #else
>>  			"%s%s[%d]: segfault at %lx ip %lx sp %lx error %lx\n",
>>  #endif
> 
> With the ongoing unification work, it would be nice if we could come
> up with a way to unify printks like this.  Anyone have any bright ideas
> on a format that will keep the current alignment on 32 and 64 bit with
> the same syntax, or will these tiny ifdefs keep sprouting?
> 

Casting to (void *) and using %p is probably your best bet.  That's what 
it really is anyway.

Note: in the kernel right now, %p doesn't have the leading 0x prefix, 
which it probably should...

	-hpa

  reply	other threads:[~2008-01-17  3:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-16 22:27 [PATCH] [0/7] Some random x86 patches that should all go into git-x86 Andi Kleen
2008-01-16 22:27 ` [PATCH] [1/7] i386: Move MWAIT idle check to generic CPU initialization Andi Kleen
2008-01-16 22:27 ` [PATCH] [2/7] Use the correct cpuid method to detect MWAIT support for C states Andi Kleen
2008-01-16 22:27 ` [PATCH] [3/7] Use shorter addresses in i386 segfault printks Andi Kleen
2008-01-17  2:58   ` Harvey Harrison
2008-01-17  3:11     ` H. Peter Anvin [this message]
2008-01-17  3:22       ` Harvey Harrison
2008-01-17  3:21         ` H. Peter Anvin
2008-01-17 11:27     ` Andi Kleen
2008-01-16 22:27 ` [PATCH] [4/7] Print which shared library/executable faulted in segfault etc. messages Andi Kleen
2008-01-16 22:27 ` [PATCH] [5/7] Replace hard coded reservations in x86-64 early boot code with dynamic table v2 Andi Kleen
2008-01-16 22:27 ` [PATCH] [6/7] Optimize lock prefix switching to run less frequently v2 Andi Kleen
2008-01-16 22:27 ` [PATCH] [7/7] Don't disable the APIC if it hasn't been mapped yet Andi Kleen
2008-01-18  9:43 ` [PATCH] [0/7] Some random x86 patches that should all go into git-x86 Ingo Molnar

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=478EC77E.8090103@zytor.com \
    --to=hpa@zytor.com \
    --cc=ak@suse.de \
    --cc=harvey.harrison@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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