linux/drivers/staging/media
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
..
atomisp module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
av7110 media fixes for v6.12-rc7 2024-11-08 07:41:27 -10:00
deprecated/atmel Staging driver changes for 6.13-rc1 2024-11-29 11:36:13 -08:00
imx Staging driver changes for 6.13-rc1 2024-11-29 11:36:13 -08:00
ipu3 staging: media: drop vb2_ops_wait_prepare/finish 2024-10-28 09:20:09 +01:00
max96712 media: staging: max96712: Add support for MAX96724 2024-10-16 09:32:38 +02:00
meson/vdec Staging driver changes for 6.13-rc1 2024-11-29 11:36:13 -08:00
rkvdec Staging driver changes for 6.13-rc1 2024-11-29 11:36:13 -08:00
starfive Staging driver changes for 6.13-rc1 2024-11-29 11:36:13 -08:00
sunxi Staging driver changes for 6.13-rc1 2024-11-29 11:36:13 -08:00
tegra-video Staging driver changes for 6.13-rc1 2024-11-29 11:36:13 -08:00
Kconfig media: staging: drop omap4iss 2024-10-08 13:43:47 +02:00
Makefile media: staging: drop omap4iss 2024-10-08 13:43:47 +02:00