aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-10-31 20:13:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-31 20:30:57 -0400
commit67d0a0754455f89ef3946946159d8ec9e45ce33a (patch)
tree297c25551f6523bc8284c40642491113e72b350e
parentfc23af34b00ef444eec088f744983b9ca6c7f5d1 (diff)
kernel.h/checkpatch: mark strict_strto<foo> and simple_strto<foo> as obsolete
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/kernel.h4
-rwxr-xr-xscripts/checkpatch.pl6
2 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 4824f26a0dc2..4c0d3b2fd5fc 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -287,6 +287,8 @@ static inline int __must_check kstrtos32_from_user(const char __user *s, size_t
287 return kstrtoint_from_user(s, count, base, res); 287 return kstrtoint_from_user(s, count, base, res);
288} 288}
289 289
290/* Obsolete, do not use. Use kstrto<foo> instead */
291
290extern unsigned long simple_strtoul(const char *,char **,unsigned int); 292extern unsigned long simple_strtoul(const char *,char **,unsigned int);
291extern long simple_strtol(const char *,char **,unsigned int); 293extern long simple_strtol(const char *,char **,unsigned int);
292extern unsigned long long simple_strtoull(const char *,char **,unsigned int); 294extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
@@ -296,6 +298,8 @@ extern long long simple_strtoll(const char *,char **,unsigned int);
296#define strict_strtoull kstrtoull 298#define strict_strtoull kstrtoull
297#define strict_strtoll kstrtoll 299#define strict_strtoll kstrtoll
298 300
301/* lib/printf utilities */
302
299extern __printf(2, 3) int sprintf(char *buf, const char * fmt, ...); 303extern __printf(2, 3) int sprintf(char *buf, const char * fmt, ...);
300extern __printf(2, 0) int vsprintf(char *buf, const char *, va_list); 304extern __printf(2, 0) int vsprintf(char *buf, const char *, va_list);
301extern __printf(3, 4) 305extern __printf(3, 4)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 0b3e35c9ef08..5ba679c8cde6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3151,10 +3151,10 @@ sub process {
3151 "consider using a completion\n" . $herecurr); 3151 "consider using a completion\n" . $herecurr);
3152 3152
3153 } 3153 }
3154# recommend kstrto* over simple_strto* 3154# recommend kstrto* over simple_strto* and strict_strto*
3155 if ($line =~ /\bsimple_(strto.*?)\s*\(/) { 3155 if ($line =~ /\b((simple|strict)_(strto(l|ll|ul|ull)))\s*\(/) {
3156 WARN("CONSIDER_KSTRTO", 3156 WARN("CONSIDER_KSTRTO",
3157 "consider using kstrto* in preference to simple_$1\n" . $herecurr); 3157 "$1 is obsolete, use k$3 instead\n" . $herecurr);
3158 } 3158 }
3159# check for __initcall(), use device_initcall() explicitly please 3159# check for __initcall(), use device_initcall() explicitly please
3160 if ($line =~ /^.\s*__initcall\s*\(/) { 3160 if ($line =~ /^.\s*__initcall\s*\(/) {