linux-stable/drivers/staging
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
..
axis-fifo staging: Switch back to struct platform_driver::remove() 2024-10-09 11:54:53 +02:00
fbtft staging: Switch back to struct platform_driver::remove() 2024-10-09 11:54:53 +02:00
gpib Staging: gpib: gpib_os.c - Remove unnecessary OOM message 2024-11-10 08:04:18 +01:00
greybus staging: greybus: uart: Fix atomicity violation in get_serial_info() 2024-11-10 08:02:37 +01:00
iio module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
media module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
most staging: most: Remove TODO contact information 2024-11-10 08:03:31 +01:00
nvec staging: Switch back to struct platform_driver::remove() 2024-10-09 11:54:53 +02:00
octeon staging: Switch back to struct platform_driver::remove() 2024-10-09 11:54:53 +02:00
rtl8723bs staging: rtl8723bs: Remove TODO contact information 2024-11-10 08:03:30 +01:00
sm750fb staging: sm750fb: Remove TODO contact information 2024-11-10 08:03:30 +01:00
vc04_services Staging driver changes for 6.13-rc1 2024-11-29 11:36:13 -08:00
vme_user staging: vme_user: vme_bridge.h: Name function pointer arguments 2024-11-04 00:51:10 +01:00
Kconfig staging: fieldbus: Delete unused driver 2024-11-04 00:53:07 +01:00
Makefile staging: fieldbus: Delete unused driver 2024-11-04 00:53:07 +01:00