linux/arch
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
..
alpha Driver core changes for 6.13-rc1 2024-11-29 11:43:29 -08:00
arc - The series "zram: optimal post-processing target selection" from 2024-11-23 09:58:07 -08:00
arm Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
arm64 module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
csky - The series "zram: optimal post-processing target selection" from 2024-11-23 09:58:07 -08:00
hexagon - The series "resource: A couple of cleanups" from Andy Shevchenko 2024-11-25 16:09:48 -08:00
loongarch dmaengine updates for v6.13 2024-11-27 13:25:47 -08:00
m68k RTC for 6.13 2024-11-30 11:18:16 -08:00
microblaze - The series "zram: optimal post-processing target selection" from 2024-11-23 09:58:07 -08:00
mips Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
nios2 - The series "zram: optimal post-processing target selection" from 2024-11-23 09:58:07 -08:00
openrisc - The series "zram: optimal post-processing target selection" from 2024-11-23 09:58:07 -08:00
parisc parisc architecture fixes for kernel v6.13-rc1: 2024-11-26 14:49:20 -08:00
powerpc module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
riscv ARM: 2024-11-30 14:51:08 -08:00
s390 module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
sh Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
sparc Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
um Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
x86 module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
xtensa - The series "resource: A couple of cleanups" from Andy Shevchenko 2024-11-25 16:09:48 -08:00
.gitignore
Kconfig Kbuild updates for v6.13 2024-11-30 13:41:50 -08:00