]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
kernel.h/checkpatch: mark strict_strto<foo> and simple_strto<foo> as obsolete
authorJoe Perches <joe@perches.com>
Wed, 5 Oct 2011 00:43:40 +0000 (11:43 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 13 Oct 2011 06:49:49 +0000 (17:49 +1100)
Mark obsolete/deprecated strict_strto<foo> and simple_strto<foo> functions
and macros as obsolete.

Update checkpatch to warn about their use.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/kernel.h
scripts/checkpatch.pl

index e40c950e1d62154e936af89e84bba215cefada91..a10ed77bd06c863ae3a33e6d0e9faa17613c0b43 100644 (file)
@@ -287,6 +287,8 @@ static inline int __must_check kstrtos32_from_user(const char __user *s, size_t
        return kstrtoint_from_user(s, count, base, res);
 }
 
+/* Obsolete, do not use.  Use kstrto<foo> instead */
+
 extern unsigned long simple_strtoul(const char *,char **,unsigned int);
 extern long simple_strtol(const char *,char **,unsigned int);
 extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
@@ -296,6 +298,8 @@ extern long long simple_strtoll(const char *,char **,unsigned int);
 #define strict_strtoull        kstrtoull
 #define strict_strtoll kstrtoll
 
+/* lib/printf utilities */
+
 extern __printf(2, 3) int sprintf(char *buf, const char * fmt, ...);
 extern __printf(2, 0) int vsprintf(char *buf, const char *, va_list);
 extern __printf(3, 4)
index 1894365e8b60785adae0c972c1241f2739058b9e..2300964f036d4f595790a6b38af02c5e67fd718a 100755 (executable)
@@ -3165,10 +3165,10 @@ sub process {
                             "consider using a completion\n" . $herecurr);
 
                }
-# recommend kstrto* over simple_strto*
-               if ($line =~ /\bsimple_(strto.*?)\s*\(/) {
+# recommend kstrto* over simple_strto* and strict_strto*
+               if ($line =~ /\b((simple|strict)_(strto(l|ll|ul|ull)))\s*\(/) {
                        WARN("CONSIDER_KSTRTO",
-                            "consider using kstrto* in preference to simple_$1\n" . $herecurr);
+                            "$1 is obsolete, use k$3 instead\n" . $herecurr);
                }
 # check for __initcall(), use device_initcall() explicitly please
                if ($line =~ /^.\s*__initcall\s*\(/) {