Powered by Linux
[PATCH 5/9] check_kernel_printf.c: remove some %pIS false positives — Semantic Matching Tool

[PATCH 5/9] check_kernel_printf.c: remove some %pIS false positives

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

 



struct __kernel_sockaddr_storage is clearly also ok to pass to %pIS,
so add that to the whitelist.

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

diff --git a/check_kernel_printf.c b/check_kernel_printf.c
index 88aeee8..6b2b96f 100644
--- a/check_kernel_printf.c
+++ b/check_kernel_printf.c
@@ -441,7 +441,8 @@ static void ipS(const char *fmt, struct symbol *type, struct symbol *basetype, i
 	 */
 	if (!has_struct_tag(basetype, "sockaddr") &&
 	    !has_struct_tag(basetype, "sockaddr_in") &&
-	    !has_struct_tag(basetype, "sockaddr_in6"))
+	    !has_struct_tag(basetype, "sockaddr_in6") &&
+	    !has_struct_tag(basetype, "__kernel_sockaddr_storage"))
 		sm_msg("error: '%%p%cS' expects argument of type struct sockaddr *, "
 			"argument %d has type '%s'", fmt[0], vaidx, type_to_str(type));
 }
-- 
2.6.1

--
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