linux-stable/drivers/pci/controller/mobiveil
Nick Alcock f98954b293 PCI: Remove MODULE_LICENSE so boolean drivers don't look like modules
Since 8b41fc4454 ("kbuild: create modules.builtin without
Makefile.modbuiltin or tristate.conf"), MODULE_LICENSE declarations are
used to identify modules. As a consequence, MODULE_LICENSE in non-modules
causes modprobe to misidentify the object file as a module when it is not,
and modprobe might succeed rather than failing with a suitable error
message.

For tristate modules that can be either built-in or loaded at runtime,
modprobe succeeds in both cases:

  # modprobe ext4
  [exit status zero if CONFIG_EXT4_FS=y or =m]

For boolean modules like the Standard Hot Plug Controller driver (shpchp)
that cannot be loaded at runtime, modprobe should always fail like this:

  # modprobe shpchp
  modprobe: FATAL: Module shpchp not found in directory /lib/modules/...
  [exit status non-zero regardless of CONFIG_HOTPLUG_PCI_SHPC]

but prior to this commit, shpchp_core.c contained MODULE_LICENSE, so
"modprobe shpchp" silently succeeded when it should have failed.

Remove MODULE_LICENSE in files that cannot be built as modules.

[bhelgaas: commit log, squash]
Suggested-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20230216152410.4312-1-nick.alcock@oracle.com/
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Hitomi Hasegawa <hasegawa-hitomi@fujitsu.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
2023-02-17 08:47:58 -06:00
..
Kconfig PCI/MSI: Get rid of PCI_MSI_IRQ_DOMAIN 2022-11-17 15:15:19 +01:00
Makefile PCI: mobiveil: Add PCIe Gen4 RC driver for Layerscape SoCs 2020-02-21 11:54:12 +00:00
pcie-layerscape-gen4.c PCI: ls-gen4: Rename ls_pcie_g4 to ls_g4_pcie 2022-01-03 15:01:59 -06:00
pcie-mobiveil-host.c PCI: Add defines for normal and subtractive PCI bridges 2022-02-17 15:29:35 -06:00
pcie-mobiveil-plat.c PCI: Remove MODULE_LICENSE so boolean drivers don't look like modules 2023-02-17 08:47:58 -06:00
pcie-mobiveil.c PCI: mobiveil: Fix sparse different address space warnings 2020-03-17 15:38:20 +00:00
pcie-mobiveil.h PCI: mobiveil: Use pci_is_root_bus() to check if bus is root bus 2020-07-23 11:20:50 +01:00