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-04-20 11:43:22 +02:00
2021-08-05 12:31:34 +02:00
2020-12-04 16:48:07 +01:00
2024-09-13 07:54:23 +02:00
2024-08-25 13:45:56 +02:00
2024-10-13 14:02:47 +02:00
2024-09-13 07:54:50 +02:00
2023-08-04 14:48:55 +02:00
2023-07-27 10:37:30 +02:00
2024-06-20 19:18:24 +02:00
2022-09-27 10:37:09 +02:00
2024-10-04 15:16:17 +02:00
2024-06-20 19:18:24 +02:00
2024-10-04 15:36:51 +02:00
2024-09-27 08:18:43 -07:00
2022-10-20 12:11:56 +02:00
2022-04-23 10:33:53 +02:00
2024-03-27 07:57:16 +01:00
2024-03-27 07:57:16 +01:00
2024-10-14 08:03:44 +02:00
2024-09-11 15:36:25 +02:00
2024-10-04 15:13:03 +02:00
2021-05-21 20:10:43 +02:00
2024-07-25 06:53:47 -05:00
2024-10-04 15:13:03 +02:00
2024-06-20 19:18:57 +02:00
2024-12-02 11:34:44 -08:00
2020-08-28 09:48:33 +02:00
2023-08-04 14:48:55 +02:00
2024-11-13 15:09:51 +01:00
2024-04-04 17:07:48 +02:00
2024-10-14 08:03:44 +02:00