1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-22 07:53:11 -05:00
linux/drivers/nvdimm
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
..
badrange.c
btt.c 6.11 updates for libnvdimm 2024-07-20 11:26:02 -07:00
btt.h
btt_devs.c
bus.c driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
claim.c
core.c nvdimm: add missing MODULE_DESCRIPTION() macros 2024-06-17 18:41:48 -05:00
dax_devs.c nvdimm: rectify the illogical code within nd_dax_probe() 2024-11-13 12:58:37 -06:00
dimm.c
dimm_devs.c
e820.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
Kconfig
label.c
label.h
Makefile
namespace_devs.c nvdimm: Remove dead code for ENODEV checking in scan_labels() 2024-08-21 16:06:43 -05:00
nd-core.h
nd.h nvdimm: rectify the illogical code within nd_dax_probe() 2024-11-13 12:58:37 -06:00
nd_perf.c
nd_virtio.c nvdimm: Correct some typos in comments 2024-11-13 12:32:57 -06:00
of_pmem.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
pfn.h
pfn_devs.c nvdimm: Correct some typos in comments 2024-11-13 12:32:57 -06:00
pmem.c nvdimm: Correct some typos in comments 2024-11-13 12:32:57 -06:00
pmem.h
region.c
region_devs.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
security.c
virtio_pmem.c virtio_pmem: Add freeze/restore callbacks 2024-11-12 18:07:24 -05:00
virtio_pmem.h