Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit caac1d5f authored by Heba Aamer's avatar Heba Aamer Committed by Linus Torvalds
Browse files

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: default avatarHeba Aamer <heba93aamer@gmail.com>
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f8e58219
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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) {