diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2022-08-01 18:39:00 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2022-08-04 20:32:13 +0900 |
commit | 7452dd26a59a9dfcde3f179594f3be6c4752a9a9 (patch) | |
tree | c7f1fdae3c6cdf93e26c279289545e4dccd31ac3 /lib/assoc_array.c | |
parent | 072dd2c8928f2ecdc52cdf5acf30479b327386c9 (diff) | |
download | linux-7452dd26a59a9dfcde3f179594f3be6c4752a9a9.tar.bz2 |
modpost: add PATTERNS() helper macro
This will be useful to define a NULL-terminated array inside a function
call.
Currently, string arrays passed to match() are defined in separate
places:
static const char *const init_sections[] = { ALL_INIT_SECTIONS, NULL };
static const char *const text_sections[] = { ALL_TEXT_SECTIONS, NULL };
static const char *const optim_symbols[] = { "*.constprop.*", NULL };
...
/* Check for pattern 5 */
if (match(fromsec, text_sections) &&
match(tosec, init_sections) &&
match(fromsym, optim_symbols))
return 0;
With the new helper macro, you can list the patterns directly in the
function call, like this:
/* Check for pattern 5 */
if (match(fromsec, PATTERNS(ALL_TEXT_SECTIONS)) &&
match(tosec, PATTERNS(ALL_INIT_SECTIONS)) &&
match(fromsym, PATTERNS("*.contprop.*")))
return 0;
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'lib/assoc_array.c')
0 files changed, 0 insertions, 0 deletions