From: Eldad Zack <eldad@fogrefinery.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Joe Perches <joe@perches.com>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] kstrto*: add documentation
Date: Fri, 13 Jul 2012 00:09:37 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.02.1207122351580.21938@debianer> (raw)
In-Reply-To: <20120712212337.GA24162@fieldses.org>
On Thu, 12 Jul 2012, J. Bruce Fields wrote:
> On Thu, Jul 12, 2012 at 10:53:13PM +0200, Eldad Zack wrote:
> > +/**
> > + * kstrtoul - convert a string to an unsigned long
>
> Also, is it worth mentioning that the number is required to be followed
> by a string or newline?
I am not sure if I understand _parse_integer correctly (which is called
to do the actual parsing and has a very nice comment to it) - but it
expects a null-terminated string, but will also stop as soon as it
bumps into any other non-number character without error (please correct
me I'm wrong).
In that case maybe "This function stops parsing as soon as it gets to a
character which doesn't belong to the given base, including newline
or null.".
And now that I read it more closely, how about:
"If base is given as 0, then the base of the string is automatically
detected with the conventional semantics: If the string begins with 0x
the number will be parsed as a hexadecimel (case insensitive). If
it otherwise begins with 0, it will be parsed as an octal number.
Otherwise it will be parsed as a decimal."
Eldad
next prev parent reply other threads:[~2012-07-12 22:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-12 20:53 Eldad Zack
2012-07-12 20:53 ` [PATCH 2/2] simple_strto*: annotate function as obsolete Eldad Zack
2012-07-12 21:17 ` [PATCH 1/2] kstrto*: add documentation Stephen Boyd
2012-07-12 21:19 ` Stephen Boyd
2012-07-12 21:23 ` J. Bruce Fields
2012-07-12 22:09 ` Eldad Zack [this message]
2012-07-12 22:16 ` J. Bruce Fields
2012-07-12 22:27 ` Eldad Zack
2012-09-30 11:44 Eldad Zack
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=alpine.DEB.2.02.1207122351580.21938@debianer \
--to=eldad@fogrefinery.com \
--cc=akpm@linux-foundation.org \
--cc=bfields@fieldses.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.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
Powered by JetHome