Skip to contentSkip to conversation

Coccinelle: zalloc-simple: Adjust a message construction

PATCH In review Markus Elfring 2 participants 3 messages Nov 3, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Coccinelle: zalloc-simple: Adjust a message construction

From: Markus Elfring <[email protected]>
Date: Sun, 3 Nov 2019 20:00:30 +0100

* Simplify a message construction in a Python script rule for the semantic patch language.

* Delete also a duplicate space character then.

Fixes dfd32cad146e3624970eee9329e99d2c6ef751b3 ("dma-mapping: remove dma_zalloc_coherent()")
---
 scripts/coccinelle/api/alloc/zalloc-simple.cocci | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
scripts/coccinelle/api/alloc/zalloc-simple.cocci +4 -2
index 26cda3f48f01..c14eae1f3010 100644
@@ -217,8 +217,10 @@ p << r2.p;
 x << r2.x;
 @@
 
-msg="WARNING: dma_alloc_coherent use in %s already zeroes out memory,  so memset is not needed" % (x)
-coccilib.report.print_report(p[0], msg)
+coccilib.report.print_report(p[0],
+                             "WARNING: dma_alloc_coherent use in "
+                             + x
+                             + " already zeroes out memory. Thus memset is not needed.")
 
 //-----------------------------------------------------------------
 @r3 depends on org || report@

--
2.23.0

#1 lore raw
Quoted 5 lines · Markus Elfring

From: Markus Elfring <[email protected]>
Date: Sun, 3 Nov 2019 20:00:30 +0100

* Simplify a message construction in a Python script rule for the semantic patch language.

The benefit is what?

julia

Quoted 30 lines

* Delete also a duplicate space character then.

Fixes dfd32cad146e3624970eee9329e99d2c6ef751b3 ("dma-mapping: remove dma_zalloc_coherent()")
---
 scripts/coccinelle/api/alloc/zalloc-simple.cocci | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
scripts/coccinelle/api/alloc/zalloc-simple.cocci +4 -3
index 26cda3f48f01..c14eae1f3010 100644
@@ -217,8 +217,10 @@ p << r2.p;
 x << r2.x;
 @@
 
-msg="WARNING: dma_alloc_coherent use in %s already zeroes out memory,  so memset is not needed" % (x)
-coccilib.report.print_report(p[0], msg)
+coccilib.report.print_report(p[0],
+                             "WARNING: dma_alloc_coherent use in "
+                             + x
+                             + " already zeroes out memory. Thus memset is not needed.")
 
 //-----------------------------------------------------------------
 @r3 depends on org || report@
--

2.23.0

#2 lore raw
Quoted 4 lines
Quoted 2 lines

* Simplify a message construction in a Python script rule for the semantic patch language.

The benefit is what?

The avoidance to store the shown string in the extra Python variable “msg”.

Quoted 1 line
Quoted 1 line

* Delete also a duplicate space character then.

I find the proposed wording a bit nicer, don't you?

Regards,
Markus