Peter Zijlstra cdd30ebb1b module: Convert symbol namespace to string literal
Clean up the existing export namespace code along the same lines of
commit 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.

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-11-01 07:37:10 -10:00
2024-11-22 12:33:52 -08:00
2024-07-15 11:14:59 -07:00
2024-11-26 13:39:02 -08:00
2024-11-25 17:08:27 +09:00
2024-09-16 09:14:02 +02:00
2024-11-26 12:50:58 -08:00
2024-10-17 00:28:06 -07:00
2024-11-27 13:11:58 -08:00
2024-11-26 12:34:50 -08:00
2024-11-18 09:35:30 -08:00
2024-11-26 18:15:06 +01:00
2024-11-26 12:59:30 -08:00
2024-11-30 10:17:53 -08:00
2024-11-26 12:59:30 -08:00
\n
2024-11-21 09:55:45 -08:00
2024-11-22 20:55:42 -08:00
2024-11-27 08:11:46 -08:00
2024-05-28 11:52:53 +02:00
\n
2024-11-21 09:50:18 -08:00
2024-08-21 22:32:58 +02:00
2024-11-30 10:14:42 -08:00
2024-11-22 20:50:55 -08:00
2024-10-02 12:02:15 -07:00
2024-11-03 01:28:06 -05:00
2024-11-21 08:28:08 -08:00
2024-11-26 13:26:15 -08:00
2024-11-18 10:30:29 -08:00
2024-11-18 10:45:06 -08:00
2024-11-03 01:28:06 -05:00
2024-11-03 01:28:06 -05:00
2024-10-21 16:29:38 +02:00
2024-11-03 01:28:06 -05:00
2024-10-21 16:29:38 +02:00
2024-09-24 15:29:42 -07:00
2024-09-16 11:15:26 +02:00
2024-09-27 08:18:43 -07:00
\n
2024-11-21 09:55:45 -08:00
2024-10-24 13:54:51 +02:00
2024-09-27 08:18:43 -07:00
2024-11-03 01:28:07 -05:00
2024-11-03 01:28:07 -05:00
2024-11-03 01:28:06 -05:00
2024-11-03 01:28:06 -05:00
2024-11-03 01:28:06 -05:00
2024-11-03 01:28:06 -05:00