linux-stable/drivers/pci/pcie
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
..
aer_inject.c PCI/AER: Use PCI_DEVID() macro in aer_inject() 2024-09-01 17:05:45 +00:00
aer.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
aspm.c PCI/ASPM: Add notes about enabling PCI-PM L1SS to pci_enable_link_state(_locked) 2024-11-06 21:16:26 +00:00
bwctrl.c thermal: Add PCIe cooling driver 2024-11-16 10:09:30 -06:00
dpc.c PCI/DPC: Disable DPC service on suspend 2024-06-18 14:51:23 -05:00
edr.c PCI/EDR: Align EDR_PORT_LOCATE_DSM with PCI Firmware r3.3 2024-05-08 15:08:39 -05:00
err.c PCI/ERR: Cleanup misleading indentation inside if conditions 2024-04-29 10:33:29 -05:00
Kconfig PCI/AER: Update aer-inject tool source URL 2024-04-17 10:35:43 -05:00
Makefile PCI/bwctrl: Re-add BW notification portdrv as PCIe BW controller 2024-11-16 10:09:04 -06:00
pme.c PCI/PME: Use FIELD_GET() 2023-10-24 16:55:45 -05:00
portdrv.c PCI/bwctrl: Re-add BW notification portdrv as PCIe BW controller 2024-11-16 10:09:04 -06:00
portdrv.h PCI/bwctrl: Re-add BW notification portdrv as PCIe BW controller 2024-11-16 10:09:04 -06:00
ptm.c PCI/PTM: Use FIELD_GET() 2023-10-24 16:55:45 -05:00
rcec.c PCI/RCEC: Fix RCiEP device to RCEC association 2021-03-10 15:10:46 -06:00