[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20150131223825.GA5314@mohammed-Inspiron-3537>
Date: Sun, 1 Feb 2015 00:38:25 +0200
From: Heba Aamer <heba93aamer@...il.com>
To: apw@...onical.com, joe@...ches.com
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH v2] checkpatch: enhance check for seq_printf uses that could
be seq_puts
This patch enhances the check for seq_printf uses that could
be seq_puts.
It was considering the escape of % is \%, but it is %%.
This led to skipping some valid cases related to that warning.
Signed-off-by: Heba Aamer <heba93aamer@...il.com>
---
v2: remove not needed if condition
scripts/checkpatch.pl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f0bb6d6..e3ebfe6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4804,7 +4804,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) {
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists