From: Al Viro <viro@ftp.linux.org.uk>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] use %p for pointers
Date: Wed, 11 Oct 2006 15:54:41 +0100 [thread overview]
Message-ID: <20061011145441.GB29920@ftp.linux.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.61.0610111316120.26779@yvahk01.tjqt.qr>
On Wed, Oct 11, 2006 at 01:16:56PM +0200, Jan Engelhardt wrote:
>
> >diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c
> >index ddc0681..b30372f 100644
> >--- a/drivers/sbus/char/uctrl.c
> >+++ b/drivers/sbus/char/uctrl.c
> >@@ -400,7 +400,7 @@ static int __init ts102_uctrl_init(void)
> > }
> >
> > driver->regs->uctrl_intr = UCTRL_INTR_RXNE_REQ|UCTRL_INTR_RXNE_MSK;
> >- printk("uctrl: 0x%x (irq %d)\n", driver->regs, driver->irq);
> >+ printk("uctrl: 0x%p (irq %d)\n", driver->regs, driver->irq);
>
> So what's the difference, except that %p will evaluate to (nil) or
> (null) when the argument is 0 [this is the case with glibc]?
> That would print 0x(nil).
%p will do no such thing in the kernel. As for the difference... %x
might happen to work on some architectures (where sizeof(void *)==sizeof(int)),
but it's not portable _and_ not right. %p is proper C for that...
next prev parent reply other threads:[~2006-10-11 14:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-10 21:49 [PATCH] use %p for pointers Al Viro
2006-10-10 21:58 ` David Miller
2006-10-11 11:16 ` Jan Engelhardt
2006-10-11 14:54 ` Al Viro [this message]
2006-10-11 18:45 ` H. Peter Anvin
2006-10-11 19:13 ` Jan Engelhardt
2006-10-11 19:16 ` H. Peter Anvin
2006-10-11 19:28 ` Jan Engelhardt
2006-10-11 20:28 ` Jakub Jelinek
2006-10-11 20:39 ` H. Peter Anvin
2006-10-12 11:03 ` Nikita Danilov
2006-10-12 11:49 ` Andreas Schwab
2006-10-12 12:02 ` Nikita Danilov
2006-10-12 12:33 ` Jan Engelhardt
2006-10-15 15:39 ` Jan Engelhardt
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=20061011145441.GB29920@ftp.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=jengelh@linux01.gwdg.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.