linux-stable/drivers/base/firmware_loader
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
..
builtin module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
fallback_platform.c firmware: Store opt_flags in fw_priv 2020-10-05 13:37:04 +02:00
fallback_table.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
fallback.c firmware_loader: Abort all upcoming firmware load request once reboot triggered 2023-10-27 13:30:38 +02:00
fallback.h firmware_loader: Refactor kill_pending_fw_fallback_reqs() 2023-10-27 13:30:38 +02:00
firmware.h firmware_loader: Abort all upcoming firmware load request once reboot triggered 2023-10-27 13:30:38 +02:00
Kconfig rust: add firmware abstractions 2024-06-18 18:45:12 +02:00
main.c firmware_loader: Fix possible resource leak in fw_log_firmware_info() 2024-11-13 07:13:50 +01:00
Makefile firmware_loader: Add firmware-upload support 2022-04-26 12:34:28 +02:00
sysfs_upload.c firmware_loader: Expand Firmware upload error codes with firmware invalid error 2023-11-24 18:09:19 -08:00
sysfs_upload.h firmware_loader: Move definitions from sysfs_upload.h to sysfs.h 2022-04-29 16:49:44 +02:00
sysfs.c driver core: class: mark the struct class for sysfs callbacks as constant 2023-03-29 07:54:58 +02:00
sysfs.h module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00