lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 11 Jun 2010 13:26:38 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Alexey Dobriyan <adobriyan@...il.com>
Cc:	linux-kernel@...r.kernel.org, yi.y.yang@...el.com,
	Jiri Kosina <trivial@...nel.org>,
	Wolfram Sang <w.sang@...gutronix.de>
Subject: Re: [PATCH 1/2] kstrto*: converting strings to integers done
 (hopefully) right

On Thu, 10 Jun 2010 00:46:17 +0300
Alexey Dobriyan <adobriyan@...il.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ