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

Unified · Split

scripts/coccinelle/misc/newline_in_nl_msg.cocci+8−5
@@ -1,7 +1,6 @@
1// SPDX-License-Identifier: GPL-2.0-only1// SPDX-License-Identifier: GPL-2.0-only
2///2///
3/// Catch strings ending in newline with GENL_SET_ERR_MSG, NL_SET_ERR_MSG,3/// Catch strings ending in newline with (GE)NL_SET_ERR_MSG*.
4/// NL_SET_ERR_MSG_MOD.
5///4///
6// Confidence: Very High5// Confidence: Very High
7// Copyright: (C) 2020 Intel Corporation6// Copyright: (C) 2020 Intel Corporation
@@ -17,7 +16,11 @@ expression e; · 9 unmodified lines
17constant m;16constant m;
18position p;17position p;
19@@18@@
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,...)
21 24
22@script:python@25@script:python@
23m << r.m;26m << r.m;
@@ -32,7 +35,7 @@ expression r.e; · 8 unmodified lines
32constant r.m;35constant r.m;
33position r.p;36position r.p;
34@@37@@
35 fname(e,m@p)38 fname(e,m@p,...)
36 39
37//----------------------------------------------------------40//----------------------------------------------------------
38// For context mode41// For context mode
@@ -43,7 +46,7 @@ identifier r1.fname; · 4 unmodified lines
43expression r.e;46expression r.e;
44constant r.m;47constant r.m;
45@@48@@
46* fname(e,m)49* fname(e,m,...)
47 50
48//----------------------------------------------------------51//----------------------------------------------------------
49// For org mode52// For org mode