public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Bjørn Mork" <bjorn@mork.no>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Davidlohr Bueso <davidlohr.bueso@hp.com>,
	"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: Thu, 30 May 2013 13:08:10 +0200	[thread overview]
Message-ID: <87obbsohd1.fsf@nemi.mork.no> (raw)
In-Reply-To: <51A6768B.5050603@cogentembedded.com> (Sergei Shtylyov's message of "Thu, 30 May 2013 01:43:39 +0400")

Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> writes:

>     Why not "text:%#lx" as already used in this string? It's
> equivalent to "0x%lx".

Well, I don't know the reasoning in this case, but I'd like to note that
those are not strictly equivalent.  Personally I find the formatting of 0
annoying enough to avoid %#x for any value which may be 0.  It's
especially bad if you try to line up things by adding leading zeros.

I would expect these to produce the same result, but they don't:

	printf("0x%02hhx\n", 0);
	printf("%#04hhx\n", 0);

Ending up with a 4 digit output when you expect 2 is very confusing.  It
doesn't matter that 0 is 0 in any case.  Why doesn't the same happen to
1 then?  This is just inconsistent behaviour, and I see no valid excuse
for it.

IMHO the single format character saved isn't worth this at all.  I'll
continue using 0x%x


Bjørn

  reply	other threads:[~2013-05-30 11:08 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 [this message]
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
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=87obbsohd1.fsf@nemi.mork.no \
    --to=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