Powered by Linux
[PATCH 4/5] check_kernel_printf.c: prepare for more tests for integer specifiers — Semantic Matching Tool

[PATCH 4/5] check_kernel_printf.c: prepare for more tests for integer specifiers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Rasmus Villemoes <rv@xxxxxxxxxxxxxxxxxx>
---
 check_kernel_printf.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/check_kernel_printf.c b/check_kernel_printf.c
index fb8d3049..87c6744a 100644
--- a/check_kernel_printf.c
+++ b/check_kernel_printf.c
@@ -1011,9 +1011,11 @@ do_check_printf_call(const char *caller, const char *name, struct expression *ca
 
 		if (spec.flags & SPECIAL && has_hex_prefix(orig_fmt, old_fmt))
 			sm_msg("warn: '%.2s' prefix is redundant when # flag is used", old_fmt-2);
-		if (is_integer_specifier(spec.type) && spec.base != 16 && has_hex_prefix(orig_fmt, old_fmt))
-			sm_msg("warn: '%.2s' prefix is confusing together with '%.*s' specifier",
-			       old_fmt-2, (int)(fmt-old_fmt), old_fmt);
+		if (is_integer_specifier(spec.type)) {
+			if (spec.base != 16 && has_hex_prefix(orig_fmt, old_fmt))
+				sm_msg("warn: '%.2s' prefix is confusing together with '%.*s' specifier",
+				       old_fmt-2, (int)(fmt-old_fmt), old_fmt);
+		}
 
 		switch (spec.type) {
 		/* case FORMAT_TYPE_NONE: */
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe smatch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux