From: Andrew Morton on 11 Jun 2010 16:30 On Thu, 10 Jun 2010 00:46:17 +0300 Alexey Dobriyan <adobriyan(a)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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|
Pages: 1 Prev: [GIT PULL] PM fix for 2.6.35 Next: kvm, ept: remove the default write bit |