History

coccinelle: Add missing (GE)NL_SET_ERR_MSG_* to strings ending with newline test

Add missing (GE)NL_SET_ERR_MSG_*() variants to the list of macros checked for strings ending with a newline.

Gal Pressman committed 1 year ago

Commit 5ace19b1 parent 38d41cf1 file · +8 −5Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/coccinelle/misc/newline_in_nl_msg.cocci+8−5
@@ -1,7 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0-only
22 ///
3−/// Catch strings ending in newline with GENL_SET_ERR_MSG, NL_SET_ERR_MSG,
4−/// NL_SET_ERR_MSG_MOD.
3+/// Catch strings ending in newline with (GE)NL_SET_ERR_MSG*.
54 ///
65 // Confidence: Very High
76 // Copyright: (C) 2020 Intel Corporation
@@ -17,7 +16,11 @@ expression e; · 9 unmodified lines
1716 constant m;
1817 position p;
1918 @@
20− \(GENL_SET_ERR_MSG\|NL_SET_ERR_MSG\|NL_SET_ERR_MSG_MOD\)(e,m@p)
19+ \(GENL_SET_ERR_MSG\|GENL_SET_ERR_MSG_FMT\|NL_SET_ERR_MSG\|NL_SET_ERR_MSG_MOD\|
20+ NL_SET_ERR_MSG_FMT\|NL_SET_ERR_MSG_FMT_MOD\|NL_SET_ERR_MSG_WEAK\|
21+ NL_SET_ERR_MSG_WEAK_MOD\|NL_SET_ERR_MSG_ATTR_POL\|
22+ NL_SET_ERR_MSG_ATTR_POL_FMT\|NL_SET_ERR_MSG_ATTR\|
23+ NL_SET_ERR_MSG_ATTR_FMT\)(e,m@p,...)
2124
2225 @script:python@
2326 m << r.m;
@@ -32,7 +35,7 @@ expression r.e; · 8 unmodified lines
3235 constant r.m;
3336 position r.p;
3437 @@
35− fname(e,m@p)
38+ fname(e,m@p,...)
3639
3740 //----------------------------------------------------------
3841 // For context mode
@@ -43,7 +46,7 @@ identifier r1.fname; · 4 unmodified lines
4346 expression r.e;
4447 constant r.m;
4548 @@
46−* fname(e,m)
49+* fname(e,m,...)
4750
4851 //----------------------------------------------------------
4952 // For org mode