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:27:36 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.02.1207130021280.22180@debianer> (raw)
In-Reply-To: <20120712221622.GD24162@fieldses.org>
On Thu, 12 Jul 2012, J. Bruce Fields wrote:
> On Fri, Jul 13, 2012 at 12:09:37AM +0200, Eldad Zack wrote:
> >
> > On Thu, 12 Jul 2012, J. Bruce Fields wrote:
> > 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).
>
> I believe it, but, in _kstrtoull:
>
> rv = _parse_integer(s, base, &_res);
> if (rv & KSTRTOX_OVERFLOW)
> return -ERANGE;
> rv &= ~KSTRTOX_OVERFLOW;
> if (rv == 0)
> return -EINVAL;
> s += rv;
> if (*s == '\n')
> s++;
> if (*s)
> return -EINVAL;
>
> So actually it appears the string must be all numeric except possibly a final
> newline.
Ah. You're right of course. Thanks! I also noticed I missed the SGML
templates, so I'll resend this at some point later.
Eldad
next prev parent reply other threads:[~2012-07-12 22:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-12 20:53 [PATCH 1/2] kstrto*: add documentation 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
2012-07-12 22:16 ` J. Bruce Fields
2012-07-12 22:27 ` Eldad Zack [this message]
-- strict thread matches above, loose matches on Subject: below --
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.1207130021280.22180@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