summaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorHeba Aamer <heba93aamer@gmail.com>2015-02-13 14:38:49 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-13 21:21:40 -0800
commitcaac1d5fddf2d55e1e1fd6d86f6fc178c801e286 (patch)
tree6a903f936b70146365303d8017fb1d5d34e7f150 /scripts/checkpatch.pl
parentf8e58219dc58cce633697fe15e6c5597bedb296b (diff)
downloadop-kernel-dev-caac1d5fddf2d55e1e1fd6d86f6fc178c801e286.zip
op-kernel-dev-caac1d5fddf2d55e1e1fd6d86f6fc178c801e286.tar.gz
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 <heba93aamer@gmail.com> Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 059c032..7f1804e 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) {
OpenPOWER on IntegriCloud