From: Joe Perches Date: Thu, 3 Apr 2014 21:49:16 +0000 (-0700) Subject: checkpatch: avoid sscanf test duplicated messages X-Git-Tag: v3.15-rc1~106^2~88 X-Git-Url: http://git.cascardo.info/?a=commitdiff_plain;h=6c8bd7076d79687183126fa7ffaa700fc2007d81;p=cascardo%2Flinux.git checkpatch: avoid sscanf test duplicated messages Change a test of $dstat to $line to avoid possibly emitting the sscanf warning multiple times. Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 9f12213d81cf..e7c50977fe3d 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -4188,7 +4188,7 @@ sub process { # check for naked sscanf if ($^V && $^V ge 5.10.0 && defined $stat && - $stat =~ /\bsscanf\b/ && + $line =~ /\bsscanf\b/ && ($stat !~ /$Ident\s*=\s*sscanf\s*$balanced_parens/ && $stat !~ /\bsscanf\s*$balanced_parens\s*(?:$Compare)/ && $stat !~ /(?:$Compare)\s*\bsscanf\s*$balanced_parens/)) {