diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2015-08-25 14:21:22 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2015-08-25 14:21:22 +1000 |
commit | a35d274d80f3ad281b281aae4d45c73a7c5d5749 (patch) | |
tree | 23b64ea280d5b98b59cd6d6ae503709bea60790f /scripts | |
parent | 15ae2bd874c58f3e51c89d4a300e18d89d8245e5 (diff) |
parse_integer: add checkpatch.pl notice
* remove check for strict_strto*(), they were fully removed long ago,
* add check for simple_strto*(), suggest replacements
sscanf() is a bit icky to suggest because it accepts arbitrary amount
of whitespace before any integer conversion, but assume programmer
knows such twist and don't use sscanf() where real strictness is
required (yes, sure...).
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d5c8e9a3a73c..f4941e2d6d02 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5498,10 +5498,10 @@ sub process { "consider using a completion\n" . $herecurr); } -# recommend kstrto* over simple_strto* and strict_strto* - if ($line =~ /\b((simple|strict)_(strto(l|ll|ul|ull)))\s*\(/) { +# simple_strto*() is deprecated + if ($line =~ /\b(simple_strto(l|ll|ul|ull))\s*\(/) { WARN("CONSIDER_KSTRTO", - "$1 is obsolete, use k$3 instead\n" . $herecurr); + "$1 is obsolete, use parse_integer(), kstrto*(), kstrto*_from_user(), sscanf() instead\n" . $herecurr); } # check for __initcall(), use device_initcall() explicitly or more appropriate function please |