[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241202151533.GF8562@noisy.programming.kicks-ass.net>
Date: Mon, 2 Dec 2024 16:15:33 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: mcgrof@...nel.org, Linus Torvalds <torvalds@...ux-foundation.org>
Cc: x86@...nel.org, hpa@...or.com, petr.pavlu@...e.com,
samitolvanen@...gle.com, da.gomez@...sung.com, masahiroy@...nel.org,
nathan@...nel.org, nicolas@...sle.eu, linux-kernel@...r.kernel.org,
linux-modules@...r.kernel.org, linux-kbuild@...r.kernel.org,
hch@...radead.org, gregkh@...uxfoundation.org
Subject: Re: [PATCH -v2 1/7] module: Convert symbol namespace to string
literal
On Mon, Dec 02, 2024 at 03:59:47PM +0100, Peter Zijlstra wrote:
> Clean up the existing export namespace code along the same lines of
> 33def8498fdd ("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.
>
> 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
Perhaps we can ask Linus to run this now, before -next fills up again ?
> Requested-by: Masahiro Yamada <masahiroy@...nel.org>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Powered by blists - more mailing lists