From: Andrew Morton <akpm@linux-foundation.org>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: linux-kernel@vger.kernel.org, yi.y.yang@intel.com,
Jiri Kosina <trivial@kernel.org>,
Wolfram Sang <w.sang@pengutronix.de>
Subject: Re: [PATCH 1/2] kstrto*: converting strings to integers done (hopefully) right
Date: Fri, 11 Jun 2010 13:26:38 -0700 [thread overview]
Message-ID: <20100611132638.976869e8.akpm@linux-foundation.org> (raw)
In-Reply-To: <20100609214616.GA31340@x200>
On Thu, 10 Jun 2010 00:46:17 +0300
Alexey Dobriyan <adobriyan@gmail.com> wrote:
> 1. simple_strto*() suck because they do not contain overflow checks
> and crufty, libc way to indicate failure.
> 2. strict_strto*() also do not have overflow checks but the name
> and comments pretend they do.
> 3. Both have only "long long" and "long" versions, but users want
> e. g. strtouint()
> 4. Both "simple" and "strict" prefixes are wrong:
> Simple doesn't say what's so simple, strict should not exist because
> conversion should be strict by default.
>
> The solution is to use "k" prefix and add convertors for more types.
>
> Enter
>
> kstrtoull(),
> kstrtoll(),
> kstrtoul(),
> kstrtol(),
> kstrtouint(),
> kstrtoint(),
> kstrtou64(),
> kstrtos64(),
> kstrtou32(),
> kstrtos32(),
> kstrtou16(),
> kstrtos16(),
> kstrtou8(),
> kstrtos8()
aw man, you're killin me. That means 100000 stupid "convert to kstro*"
patches and 10000 "please use kstrto*" comments from patch reviewers.
Or at least, one patch reviewer :(
For new code I'd like to see a checkpatch "hey dummy you used the old
API" rule, please. For old code I think I'd punt any cleanup patches
in a Jiriwards direction, OK?
But right now I'm wondering if the problems you've identified are big
enough to bother fixing.
next prev parent reply other threads:[~2010-06-11 20:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-09 21:46 [PATCH 1/2] kstrto*: converting strings to integers done (hopefully) right Alexey Dobriyan
2010-06-11 20:26 ` Andrew Morton [this message]
2010-12-06 1:26 ` Thiago Farina
2010-12-06 15:19 ` Alexey Dobriyan
2010-12-06 15:27 ` Thiago Farina
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=20100611132638.976869e8.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=adobriyan@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=trivial@kernel.org \
--cc=w.sang@pengutronix.de \
--cc=yi.y.yang@intel.com \
/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