* simple_strtoull() - FIXME?
@ 2012-03-12 16:16 Shuah Khan
2012-03-12 23:19 ` Ryan Mallon
0 siblings, 1 reply; 2+ messages in thread
From: Shuah Khan @ 2012-03-12 16:16 UTC (permalink / raw)
To: LKML; +Cc: shuahkhan
What's this FIXME in simple_strtoull() for? Something to be terribly
concerned about and need fixing (assuming there is something that still
needs fixing)
unsigned long long simple_strtoull(const char *cp, char **endp, unsigned
int base)
{
unsigned long long result;
unsigned int rv;
cp = _parse_integer_fixup_radix(cp, &base);
rv = _parse_integer(cp, base, &result);
/* FIXME */
cp += (rv & ~KSTRTOX_OVERFLOW);
if (endp)
*endp = (char *)cp;
return result;
}
EXPORT_SYMBOL(simple_strtoull);
-- Shuah
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: simple_strtoull() - FIXME?
2012-03-12 16:16 simple_strtoull() - FIXME? Shuah Khan
@ 2012-03-12 23:19 ` Ryan Mallon
0 siblings, 0 replies; 2+ messages in thread
From: Ryan Mallon @ 2012-03-12 23:19 UTC (permalink / raw)
To: shuahkhan; +Cc: LKML
On 13/03/12 03:16, Shuah Khan wrote:
> What's this FIXME in simple_strtoull() for? Something to be terribly
> concerned about and need fixing (assuming there is something that still
> needs fixing)
>
> unsigned long long simple_strtoull(const char *cp, char **endp, unsigned
> int base)
> {
> unsigned long long result;
> unsigned int rv;
>
> cp = _parse_integer_fixup_radix(cp, &base);
> rv = _parse_integer(cp, base, &result);
> /* FIXME */
git blame/show answers your question. From the commit message of
1dff46d6: lib/kstrtox: common code between kstrto*() and simple_strto*()
functions:
simple_strtoull() (and scanf(), BTW) ignores integer overflow, that's a
bug we currently don't have guts to fix, making KSTRTOX_OVERFLOW hack
necessary.
Note that simple_strtoull and friends are now deprecated (see
include/linux/kernel.h) and you should now be using the kstrto*
functions instead.
~Ryan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-12 23:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-12 16:16 simple_strtoull() - FIXME? Shuah Khan
2012-03-12 23:19 ` Ryan Mallon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox