From: Joe Perches <joe@perches.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: "Davidlohr Bueso" <davidlohr.bueso@hp.com>,
"Bjørn Mork" <bjorn@mork.no>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
netdev@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: skbuff: use _RET_IP_
Date: Fri, 31 May 2013 09:54:52 -0700 [thread overview]
Message-ID: <1370019292.10556.79.camel@joe-AO722> (raw)
In-Reply-To: <51A8B4A4.1010204@cogentembedded.com>
On Fri, 2013-05-31 at 18:33 +0400, Sergei Shtylyov wrote:
> On 31-05-2013 9:20, Joe Perches wrote:
> > Don't use a standalone gcc compiled program to
> > determine what the kernel outputs.
[]
> > The kernel output is;
>
> > printk("0x%lx\n", 0x100ul) 0x100
> > printk("%p\n", (void *)0x100ul) 00000100
> > printk("%#p\n", (void *)0x100ul) 0x00000100
>
> > The last one isn't used at all in kernel source. (gcc complains)
> > It's always "0x%p"
>
> I was talking about using "%#lx", not "%#p". I don't see it in your
> example.
"0x%lx" and "%#lx" produce the same output in the kernel.
The latter isn't used very often though.
I expect most coders don't know it exists/works.
$ git grep -E "0x%l{0,2}x" | wc -l
12542
$ git grep -E "%#l{0,2}x" | wc -l
1737
(some false positives there of course)
Also, some might expect that "%#08lx", is 10 chars wide,
but it's only 8, so maybe "0x%08lx" is better used.
The "%#08lx" width defect seems pretty common:
$ git grep -E -i "%#0(8|16)l{0,2}x" | wc -l
253
next prev parent reply other threads:[~2013-05-31 16:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-29 21:09 [PATCH] net: skbuff: use _RET_IP_ Davidlohr Bueso
2013-05-29 21:43 ` Sergei Shtylyov
2013-05-30 11:08 ` Bjørn Mork
2013-05-31 1:11 ` Davidlohr Bueso
2013-05-31 5:20 ` Joe Perches
2013-05-31 7:06 ` Bjørn Mork
2013-05-31 14:33 ` Sergei Shtylyov
2013-05-31 16:54 ` Joe Perches [this message]
2013-05-31 17:51 ` Sergei Shtylyov
2013-06-01 0:10 ` David Miller
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=1370019292.10556.79.camel@joe-AO722 \
--to=joe@perches.com \
--cc=bjorn@mork.no \
--cc=davem@davemloft.net \
--cc=davidlohr.bueso@hp.com \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sergei.shtylyov@cogentembedded.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