From: daniel@caiaq.de (Daniel Mack)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: Prefix revision number in /proc/cpuinfo
Date: Fri, 13 Nov 2009 00:17:03 +0100 [thread overview]
Message-ID: <20091112231703.GT14091@buzzloop.caiaq.de> (raw)
In-Reply-To: <20091112221307.GC12308@n2100.arm.linux.org.uk>
On Thu, Nov 12, 2009 at 10:13:07PM +0000, Russell King - ARM Linux wrote:
> On Thu, Nov 12, 2009 at 11:03:14PM +0100, Daniel Mack wrote:
> > On Thu, Nov 12, 2009 at 09:52:01PM +0000, Russell King - ARM Linux wrote:
> > > On Thu, Nov 12, 2009 at 02:58:07PM +0100, Daniel Mack wrote:
> > > > The revision field in /proc/cpuinfo is reported as hex number, so it
> > > > should have a '0x' prefix to make that clear. Otherwise, parsers
> > > > will take it as decimal number unless it contains a letter.
> > >
> > > So what you're doing is possibly breaking existing parsers (which
> > > probably already assume it is hex) to fix buggy parsers?
> >
> > I wouldn't call that fixing a buggy parser. On my board, the revision is
> > 0x101 which was parsed as 101. You can't know it is in hex unless you
> > look at the sources.
>
> However, we export lots of stuff from the kernel in hex without an '0x'
> prefix.
>
> The biggest point here, though, is that the field is already present and
> has been used, created about 10 years ago for NetWinder stuff. So we've
> about 10 years of history of it being there. Adding the '0x' prefix may
> break existing parsers, which is a good enough reason not to change it.
>
> Moreover, if you try to parse the field using strtoul, you'll generally
> end up with it being interpreted as an _octal_ number due to the leading
> zeros - which should be enough of a hint that it isn't a decimal number.
>
> If you really feel strongly about it, then the only portable way of fixing
> it would be to create a new entry in the file with the '0x' prefix.
Hmm, no. I think we will just force the parser to hex then. Not that
important. It's just that all other fields in /proc/cpuinfo which are in
hex _are_ prefixed indeed, but I see the risk of breaking existing
parsers, so let's keep it the way it is.
Thanks,
Daniel
prev parent reply other threads:[~2009-11-12 23:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-12 13:58 [PATCH] ARM: Prefix revision number in /proc/cpuinfo Daniel Mack
2009-11-12 14:30 ` Alessandro Rubini
2009-11-12 14:37 ` Daniel Mack
2009-11-12 21:52 ` Russell King - ARM Linux
2009-11-12 22:03 ` Daniel Mack
2009-11-12 22:13 ` Russell King - ARM Linux
2009-11-12 23:17 ` Daniel Mack [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=20091112231703.GT14091@buzzloop.caiaq.de \
--to=daniel@caiaq.de \
--cc=linux-arm-kernel@lists.infradead.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.