diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2018-12-09 16:57:00 +0100 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2018-12-09 16:59:19 +0100 |
commit | 225c06b5811f983285feeca43fc0e3b09404ab82 (patch) | |
tree | b326994975086883716e69ee57749c48814bb13a /tools/checkpatch.pl | |
parent | lib, tests: add support for keyless YANG lists (diff) | |
download | frr-225c06b5811f983285feeca43fc0e3b09404ab82.tar.xz frr-225c06b5811f983285feeca43fc0e3b09404ab82.zip |
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 <renato@opensourcerouting.org>
Diffstat (limited to 'tools/checkpatch.pl')
-rwxr-xr-x | tools/checkpatch.pl | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/tools/checkpatch.pl b/tools/checkpatch.pl index 547a4b213..77e6e9a33 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<foo> - 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<type> 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", |