From: Trent Piepho <xyzzy@speakeasy.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Harvey Harrison <harvey.harrison@gmail.com>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] printk: Let %pR handle NULL pointers
Date: Sun, 4 Jan 2009 12:41:49 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.58.0901041232460.25853@shell2.speakeasy.net> (raw)
In-Reply-To: <1231062493.15389.105.camel@pasglop>
On Sun, 4 Jan 2009, Benjamin Herrenschmidt wrote:
> > I thought of doing that too, but then all the various %pX formats would all
> > have to print the same for NULL pointers. For instance a resource prints
> > out like "[0x1000-0x100f]", so I chose "[NULL]" for printing a null
> > resource pointer. Maybe "[]" or "[-]" would be better? A null MAC address
> > could be ":::::" or "x:x:x:x:x:x". "N.U.L.L" or "x.x.x.x" for a null IP4
> > address. And so on. So the printout looks nicer when a NULL pointer isn't
> > a bug.
>
> And how often is that ?
For resource pointers it's not uncommon. There are many cases when it's perfectly
ok for a resource pointer to be null, e.g. res->parent is often null, pci devices
and busses don't usually have all possible ranges, etc. It nice to get decent info
printouts without having the check for NULL pointers.
prev parent reply other threads:[~2009-01-04 20:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-03 10:42 Trent Piepho
2009-01-03 17:10 ` Linus Torvalds
2009-01-03 19:33 ` Harvey Harrison
2009-01-03 21:53 ` Benjamin Herrenschmidt
2009-01-04 5:02 ` Trent Piepho
2009-01-04 5:14 ` Valdis.Kletnieks
2009-01-04 9:31 ` Johannes Berg
2009-01-04 9:48 ` Benjamin Herrenschmidt
2009-01-04 20:41 ` Trent Piepho [this message]
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=Pine.LNX.4.58.0901041232460.25853@shell2.speakeasy.net \
--to=xyzzy@speakeasy.org \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=harvey.harrison@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®