Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Link: https://patch.msgid.link/20250226093904.6632-2-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Gal Pressman and committed by
Jakub Kicinski
5ace19bd 38d41cf5

+8 -5
+8 -5
scripts/coccinelle/misc/newline_in_nl_msg.cocci
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 /// 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*. 5 4 /// 6 5 // Confidence: Very High 7 6 // Copyright: (C) 2020 Intel Corporation ··· 16 17 constant m; 17 18 position p; 18 19 @@ 19 - \(GENL_SET_ERR_MSG\|NL_SET_ERR_MSG\|NL_SET_ERR_MSG_MOD\)(e,m@p) 20 + \(GENL_SET_ERR_MSG\|GENL_SET_ERR_MSG_FMT\|NL_SET_ERR_MSG\|NL_SET_ERR_MSG_MOD\| 21 + NL_SET_ERR_MSG_FMT\|NL_SET_ERR_MSG_FMT_MOD\|NL_SET_ERR_MSG_WEAK\| 22 + NL_SET_ERR_MSG_WEAK_MOD\|NL_SET_ERR_MSG_ATTR_POL\| 23 + NL_SET_ERR_MSG_ATTR_POL_FMT\|NL_SET_ERR_MSG_ATTR\| 24 + NL_SET_ERR_MSG_ATTR_FMT\)(e,m@p,...) 20 25 21 26 @script:python@ 22 27 m << r.m; ··· 35 32 constant r.m; 36 33 position r.p; 37 34 @@ 38 - fname(e,m@p) 35 + fname(e,m@p,...) 39 36 40 37 //---------------------------------------------------------- 41 38 // For context mode ··· 46 43 expression r.e; 47 44 constant r.m; 48 45 @@ 49 - * fname(e,m) 46 + * fname(e,m,...) 50 47 51 48 //---------------------------------------------------------- 52 49 // For org mode