From caac1d5fddf2d55e1e1fd6d86f6fc178c801e286 Mon Sep 17 00:00:00 2001 From: Heba Aamer Date: Fri, 13 Feb 2015 14:38:49 -0800 Subject: [PATCH] checkpatch: improve seq_print->seq_puts suggestion Improve the format specifier test by removing any %% before looking for any remaining % format specifier. Signed-off-by: Heba Aamer Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 059c032d8882..7f1804e052f2 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -4854,7 +4854,8 @@ sub process { # check for seq_printf uses that could be seq_puts if ($sline =~ /\bseq_printf\s*\(.*"\s*\)\s*;\s*$/) { my $fmt = get_quoted_string($line, $rawline); - if ($fmt ne "" && $fmt !~ /[^\\]\%/) { + $fmt =~ s/%%//g; + if ($fmt !~ /%/) { if (WARN("PREFER_SEQ_PUTS", "Prefer seq_puts to seq_printf\n" . $herecurr) && $fix) { -- 2.20.1