From 353eb9086daad9b8e00eca8fe4cc420ab79496bd Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 21 Sep 2022 10:17:38 +0200 Subject: [PATCH] cocci: fix python issues --- qa/coccinelle/access-pkt-packet.cocci | 4 ++-- qa/coccinelle/action-pkt.cocci | 2 +- qa/coccinelle/direct-packet.cocci | 2 +- qa/coccinelle/malloc-error-check.cocci | 2 +- qa/coccinelle/pktnotset-packet.cocci | 2 +- qa/coccinelle/realloc.cocci | 2 +- qa/coccinelle/siginit.cocci | 2 +- qa/coccinelle/size_t.cocci | 2 +- qa/coccinelle/sz3.cocci | 4 ++-- qa/coccinelle/uint.cocci | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/qa/coccinelle/access-pkt-packet.cocci b/qa/coccinelle/access-pkt-packet.cocci index 681848ecf3..3402b6defa 100644 --- a/qa/coccinelle/access-pkt-packet.cocci +++ b/qa/coccinelle/access-pkt-packet.cocci @@ -30,7 +30,7 @@ p->pkt@p1 p1 << pktfield.p1; @@ -print "Invalid Packet->pkt usage, GET_PKT_DATA macro must be used at %s:%s" % (p1[0].file, p1[0].line) +print("Invalid Packet->pkt usage, GET_PKT_DATA macro must be used at %s:%s" % (p1[0].file, p1[0].line)) import sys sys.exit(1) @@ -50,6 +50,6 @@ p->pktlen@p1 p1 << pktlenfield.p1; @@ -print "Invalid Packet->pktlen usage, GET_PKT_LEN macro must be used at %s:%s" % (p1[0].file, p1[0].line) +print("Invalid Packet->pktlen usage, GET_PKT_LEN macro must be used at %s:%s" % (p1[0].file, p1[0].line)) import sys sys.exit(1) diff --git a/qa/coccinelle/action-pkt.cocci b/qa/coccinelle/action-pkt.cocci index 1a66721ac8..1392d5e8ef 100644 --- a/qa/coccinelle/action-pkt.cocci +++ b/qa/coccinelle/action-pkt.cocci @@ -10,6 +10,6 @@ p->action@p1 p1 << action.p1; @@ -print "Invalid usage of p->action, please use macro at %s:%s" % (p1[0].file, p1[0].line) +print("Invalid usage of p->action, please use macro at %s:%s" % (p1[0].file, p1[0].line)) import sys sys.exit(1) diff --git a/qa/coccinelle/direct-packet.cocci b/qa/coccinelle/direct-packet.cocci index dbe1f98bcc..b184225f71 100644 --- a/qa/coccinelle/direct-packet.cocci +++ b/qa/coccinelle/direct-packet.cocci @@ -10,6 +10,6 @@ Packet p@p1; p1 << directpacket.p1; @@ -print "Invalid Packet definition, explicit allocation must be used at %s:%s" % (p1[0].file, p1[0].line) +print("Invalid Packet definition, explicit allocation must be used at %s:%s" % (p1[0].file, p1[0].line)) import sys sys.exit(1) diff --git a/qa/coccinelle/malloc-error-check.cocci b/qa/coccinelle/malloc-error-check.cocci index 96c09f0b85..ce4d0cc47f 100644 --- a/qa/coccinelle/malloc-error-check.cocci +++ b/qa/coccinelle/malloc-error-check.cocci @@ -64,6 +64,6 @@ FAIL_IF_NULL(x) @script:python depends on !realloc && !istested && !inlinetested@ p1 << malloced.p1; @@ -print "Structure malloced at %s:%s but error is not checked." % (p1[0].file, p1[0].line) +print("Structure malloced at %s:%s but error is not checked." % (p1[0].file, p1[0].line)) import sys sys.exit(1) diff --git a/qa/coccinelle/pktnotset-packet.cocci b/qa/coccinelle/pktnotset-packet.cocci index 87f7a605c0..1b10599be3 100644 --- a/qa/coccinelle/pktnotset-packet.cocci +++ b/qa/coccinelle/pktnotset-packet.cocci @@ -24,6 +24,6 @@ PacketInit(p) p1 << zeroed.p1; @@ -print "Packet zeroed at %s:%s but pkt field is not set afterward." % (p1[0].file, p1[0].line) +print("Packet zeroed at %s:%s but pkt field is not set afterward." % (p1[0].file, p1[0].line)) import sys sys.exit(1) diff --git a/qa/coccinelle/realloc.cocci b/qa/coccinelle/realloc.cocci index 0b82880735..e9c4fc6c6b 100644 --- a/qa/coccinelle/realloc.cocci +++ b/qa/coccinelle/realloc.cocci @@ -13,6 +13,6 @@ x@p1 = (ty *) SCRealloc(x, E) @script:python@ p1 << realloc.p1; @@ -print "Structure reallocated at %s:%s but original pointer is lost and not freed in case of error." % (p1[0].file, p1[0].line) +print("Structure reallocated at %s:%s but original pointer is lost and not freed in case of error." % (p1[0].file, p1[0].line)) import sys sys.exit(1) diff --git a/qa/coccinelle/siginit.cocci b/qa/coccinelle/siginit.cocci index 9a2193be40..2bfcbd678f 100644 --- a/qa/coccinelle/siginit.cocci +++ b/qa/coccinelle/siginit.cocci @@ -21,6 +21,6 @@ goto error; @script:python@ p1 << siginit.p1; @@ -print "SigMatch added at %s:%s but error handling can cause it to be freed later." % (p1[0].file, p1[0].line) +print("SigMatch added at %s:%s but error handling can cause it to be freed later." % (p1[0].file, p1[0].line)) import sys sys.exit(1) diff --git a/qa/coccinelle/size_t.cocci b/qa/coccinelle/size_t.cocci index 4bd5b9f26c..89a13f8ed3 100644 --- a/qa/coccinelle/size_t.cocci +++ b/qa/coccinelle/size_t.cocci @@ -39,6 +39,6 @@ funcn(E1, E2,..., (uint64_t) p, ...)@p1; p1 << sizet.p1; @@ -print "Invalid printf with size_t (not casted to uintmax_t) at %s:%s" % (p1[0].file, p1[0].line) +print("Invalid printf with size_t (not casted to uintmax_t) at %s:%s" % (p1[0].file, p1[0].line)) import sys sys.exit(1) diff --git a/qa/coccinelle/sz3.cocci b/qa/coccinelle/sz3.cocci index 37a8877b42..51459c7be2 100644 --- a/qa/coccinelle/sz3.cocci +++ b/qa/coccinelle/sz3.cocci @@ -24,7 +24,7 @@ sizeof(e@p1) p1 << preuse.p1; @@ -print "Size of pointed value not pointer used at %s:%s" % (p1[0].file, p1[0].line) +print("Size of pointed value not pointer used at %s:%s" % (p1[0].file, p1[0].line)) import sys sys.exit(1) @@ -43,6 +43,6 @@ sizeof(e@p1) p1 << postuse.p1; @@ -print "Size of pointed value not pointer used at %s:%s" % (p1[0].file, p1[0].line) +print("Size of pointed value not pointer used at %s:%s" % (p1[0].file, p1[0].line)) import sys sys.exit(1) diff --git a/qa/coccinelle/uint.cocci b/qa/coccinelle/uint.cocci index 2c664288e3..d7e6af773c 100644 --- a/qa/coccinelle/uint.cocci +++ b/qa/coccinelle/uint.cocci @@ -8,6 +8,6 @@ i@p1 @script:python@ p1 << uint.p1; @@ -print "banned type uint used at at %s:%s, please use a explicit length." % (p1[0].file, p1[0].line) +print("banned type uint used at at %s:%s, please use a explicit length." % (p1[0].file, p1[0].line)) import sys sys.exit(1)