From 225c06b5811f983285feeca43fc0e3b09404ab82 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Sun, 9 Dec 2018 13:57:00 -0200 Subject: [PATCH] tools: update checkpatch to stop suggesting the use of kstrto() kstrto() is a kernel-specific function so this suggestion doesn't make sense for FRR. Signed-off-by: Renato Westphal --- tools/checkpatch.pl | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/tools/checkpatch.pl b/tools/checkpatch.pl index 547a4b2137..77e6e9a330 100755 --- a/tools/checkpatch.pl +++ b/tools/checkpatch.pl @@ -5886,27 +5886,6 @@ sub process { "unchecked sscanf return value\n" . "$here\n$stat_real\n"); } -# check for simple sscanf that should be kstrto - if ($^V && $^V ge 5.10.0 && - defined $stat && - $line =~ /\bsscanf\b/) { - my $lc = $stat =~ tr@\n@@; - $lc = $lc + $linenr; - my $stat_real = raw_line($linenr, 0); - for (my $count = $linenr + 1; $count <= $lc; $count++) { - $stat_real = $stat_real . "\n" . raw_line($count, 0); - } - if ($stat_real =~ /\bsscanf\b\s*\(\s*$FuncArg\s*,\s*("[^"]+")/) { - my $format = $6; - my $count = $format =~ tr@%@%@; - if ($count == 1 && - $format =~ /^"\%(?i:ll[udxi]|[udxi]ll|ll|[hl]h?[udxi]|[udxi][hl]h?|[hl]h?|[udxi])"$/) { - WARN("SSCANF_TO_KSTRTO", - "Prefer kstrto to single variable sscanf\n" . "$here\n$stat_real\n"); - } - } - } - # check for new externs in .h files. if ($realfile =~ /\.h$/ && $line =~ /^\+\s*(extern\s+)$Type\s*$Ident\s*\(/s) { @@ -6177,12 +6156,6 @@ 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*\(/) { - WARN("CONSIDER_KSTRTO", - "$1 is obsolete, use k$3 instead\n" . $herecurr); - } - # check for __initcall(), use device_initcall() explicitly or more appropriate function please if ($line =~ /^.\s*__initcall\s*\(/) { WARN("USE_DEVICE_INITCALL", -- 2.39.5