Peter Zijlstra
cdd30ebb1b
module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 33def8498f ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-12-02 11:34:44 -08:00
..
2023-10-18 09:48:05 -07:00
2024-01-03 12:21:36 -08:00
2024-07-20 11:26:02 -07:00
2021-06-01 07:42:23 -06:00
2024-07-03 15:16:54 +02:00
2020-12-15 21:47:45 -08:00
2024-06-17 18:41:48 -05:00
2024-11-13 12:58:37 -06:00
2024-01-03 12:21:36 -08:00
2021-02-16 19:35:29 -08:00
2024-12-01 15:12:43 -08:00
2024-02-12 14:32:25 -07:00
2022-03-11 15:53:13 -08:00
2022-03-11 15:53:13 -08:00
2022-03-23 12:17:36 -07:00
2024-08-21 16:06:43 -05:00
2023-08-17 09:34:03 -07:00
2024-11-13 12:32:57 -06:00
2023-02-25 09:19:23 -08:00
2024-11-13 12:58:37 -06:00
2024-12-01 15:12:43 -08:00
2024-11-13 12:32:57 -06:00
2020-03-17 12:23:21 -07:00
2024-11-13 12:32:57 -06:00
2022-05-16 13:35:56 -07:00
2024-12-02 11:34:44 -08:00
2022-12-02 23:52:32 -08:00
2022-12-02 23:52:32 -08:00
2024-11-12 18:07:24 -05:00
2019-07-05 15:19:10 -07:00