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
..
2024-05-31 16:11:00 +03:00
2024-05-31 16:11:36 +03:00
2024-06-19 11:38:31 +03:00
2024-06-24 16:40:29 +02:00
2024-10-13 17:10:35 +02:00
2024-10-29 04:01:40 +01:00
2022-11-23 19:43:33 +01:00
2022-09-12 15:23:11 +03:00
2023-10-18 10:01:33 +02:00
2024-03-05 14:28:02 +00:00
2023-10-18 10:01:33 +02:00
2021-02-06 15:48:11 +01:00
2024-04-23 21:44:16 -07:00
2023-10-18 10:01:34 +02:00
2023-10-18 10:01:33 +02:00
2019-03-28 02:07:54 +09:00
2022-10-08 08:56:37 -07:00
2019-03-28 02:07:54 +09:00
2024-04-11 15:13:30 +02:00
2023-10-18 10:01:34 +02:00
2023-10-18 10:01:34 +02:00
2023-12-15 17:02:15 +01:00
2024-09-27 08:18:43 -07:00
2023-12-07 11:41:40 +09:00
2023-10-18 10:01:34 +02:00
2019-03-28 02:07:54 +09:00
2024-05-22 20:14:47 -04:00
2022-09-12 15:23:11 +03:00
2024-06-04 17:11:48 +02:00
2024-03-05 14:28:02 +00:00
2024-12-02 11:34:44 -08:00
2024-12-02 11:34:44 -08:00
2024-12-02 11:34:44 -08:00
2024-04-11 15:15:53 +02:00