Skip to contentSkip to conversation

cocci: Add rules to find str_plural() replacements

PATCH In review Kees Cook 2 participants 2 messages Feb 15, 2024 – Feb 16, 2024

Subsystems (3)
lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH v2 1/1 cocci: Add rules to find str_plural() replacements

Add rules for finding places where str_plural() can be used. This currently finds:

 54 files changed, 62 insertions(+), 61 deletions(-)

---
Cc: Michal Wajdeczko <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Cc: Julia Lawall <[email protected]>
Cc: Nicolas Palix <[email protected]>
Cc: [email protected]

---
 MAINTAINERS                                 |  1 +
 scripts/coccinelle/api/string_choices.cocci | 41 +++++++++++++++++++++
 2 files changed, 42 insertions(+)
 create mode 100644 scripts/coccinelle/api/string_choices.cocci
MAINTAINERS +1 -0
index d0df728734c1..216d02a3fed5 100644
@@ -8979,6 +8979,7 @@ F:	lib/string.c
 F:	lib/string_helpers.c
 F:	lib/test-string_helpers.c
 F:	lib/test_string.c
+F:	scripts/coccinelle/api/string_choices.cocci
 
 GENERIC UIO DRIVER FOR PCI DEVICES
 M:	"Michael S. Tsirkin" <[email protected]>
scripts/coccinelle/api/string_choices.cocci new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
2.34.1
#1 lore raw
Quoted 1 line

Add rules for finding places where str_plural() can be used.

…

Quoted 2 lines

+++ b/scripts/coccinelle/api/string_choices.cocci

(quoted diff) +0 -0
@@ -0,0 +1,41 @@

…

scripts/coccinelle/api/string_choices.cocci line 8

Quoted 7 lines
scripts/coccinelle/api/string_choices.cocci new file +7 -0
+/// Find places to use string_choices.h's various helpers.
+//
+// Confidence: Medium
+// Options: --no-includes --include-headers
+virtual patch
+virtual context
+virtual report

Would you like to support another operation mode?

virtual context, patch, report, org

Regards,
Markus