hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/scripts/coccinelle/api/kstrdup.cocci
....@@ -1,9 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /// Use kstrdup rather than duplicating its implementation
23 ///
34 // Confidence: High
4
-// Copyright: (C) 2010-2012 Nicolas Palix. GPLv2.
5
-// Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6. GPLv2.
6
-// Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6. GPLv2.
5
+// Copyright: (C) 2010-2012 Nicolas Palix.
6
+// Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6.
7
+// Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6.
78 // URL: http://coccinelle.lip6.fr/
89 // Comments:
910 // Options: --no-includes --include-headers
....@@ -65,7 +66,7 @@
6566
6667 * x = strlen(from) + 1;
6768 ... when != \( x = E1 \| from = E1 \)
68
-* to = \(kmalloc@p1\|kzalloc@p2\)(x,flag);
69
+* to = \(kmalloc@p1\|kzalloc@p1\)(x,flag);
6970 ... when != \(x = E2 \| from = E2 \| to = E2 \)
7071 if (to==NULL || ...) S
7172 ... when != \(x = E3 \| from = E3 \| to = E3 \)
....@@ -76,7 +77,7 @@
7677 p2 << r1.p2;
7778 @@
7879
79
-cocci.print_main("WARNING opportunity for kstrdep",p1)
80
+cocci.print_main("WARNING opportunity for kstrdup",p1)
8081 cocci.print_secs("strcpy",p2)
8182
8283 @script:python depends on org@
....@@ -84,7 +85,7 @@
8485 p2 << r2.p2;
8586 @@
8687
87
-cocci.print_main("WARNING opportunity for kstrdep",p1)
88
+cocci.print_main("WARNING opportunity for kstrdup",p1)
8889 cocci.print_secs("memcpy",p2)
8990
9091 @script:python depends on report@
....@@ -92,7 +93,7 @@
9293 p2 << r1.p2;
9394 @@
9495
95
-msg = "WARNING opportunity for kstrdep (strcpy on line %s)" % (p2[0].line)
96
+msg = "WARNING opportunity for kstrdup (strcpy on line %s)" % (p2[0].line)
9697 coccilib.report.print_report(p1[0], msg)
9798
9899 @script:python depends on report@
....@@ -100,5 +101,5 @@
100101 p2 << r2.p2;
101102 @@
102103
103
-msg = "WARNING opportunity for kstrdep (memcpy on line %s)" % (p2[0].line)
104
+msg = "WARNING opportunity for kstrdup (memcpy on line %s)" % (p2[0].line)
104105 coccilib.report.print_report(p1[0], msg)