linux-stable/arch/powerpc
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
..
boot powerpc/64: Remove maple platform 2024-10-29 23:01:52 +11:00
configs powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
crypto module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
include - The series "resource: A couple of cleanups" from Andy Shevchenko 2024-11-25 16:09:48 -08:00
kernel powerpc/prom_init: Fixup missing powermac #size-cells 2024-11-27 10:41:10 +05:30
kexec powerpc/kexec: Fix return of uninitialized variable 2024-11-15 00:29:46 +11:00
kvm The biggest change here is eliminating the awful idea that KVM had, of 2024-11-23 16:00:50 -08:00
lib powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
net powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
perf powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
platforms powerpc/machdep: Remove duplicated include in svm.c 2024-11-27 10:38:17 +05:30
purgatory Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
sysdev powerpc/xive: Use cpumask_intersects() 2024-11-14 22:43:52 +11:00
tools powerpc/ftrace: Fix ftrace bug with KASAN=y 2024-11-10 22:33:51 +11:00
xmon powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
Kbuild powerpc64/ftrace: Move ftrace sequence out of line 2024-10-31 11:00:54 +11:00
Kconfig powerpc updates for 6.13 2024-11-23 10:44:31 -08:00
Kconfig.debug powerpc/64: Remove maple platform 2024-10-29 23:01:52 +11:00
Makefile Kbuild updates for v6.13 2024-11-30 13:41:50 -08:00
Makefile.postlink powerpc/ftrace: Add a postlink script to validate function tracer 2024-10-31 11:00:54 +11:00