From 6c8bd7076d79687183126fa7ffaa700fc2007d81 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Thu, 3 Apr 2014 14:49:16 -0700 Subject: [PATCH] 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 --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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/)) { -- 2.20.1