Skip to content

phy: remove needless usage of module header

Paul Gortmaker lkml 1 version Applied

Status from this message: merged, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3phy: make phy-core explicitly non-modulardrivers/phy/phy-core.c+1 -110 replies
2/3phy: make phy-mvebu-sata explicitly non-modulardrivers/phy/marvell/phy-mvebu-sata.c+2 -70 replies
3/3phy: make phy-armada375-usb2 explicitly non-modulardrivers/phy/marvell/phy-armada375-usb2.c+1 -71 reply

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchGregory CLEMENT
1/3
2/3
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] phy: remove needless usage of module header

The most important thing to note here, is these clean-ups make no changes to the final generated run-time. The 1st commit removes an unused function, otherwise the generated objects are also unchanged.

The work here represents a scan over the phy dir, looking for files that have nothing to do with a modular use case, but are using modular infrastructure regardless.

We are trying to make driver code consistent with the Makefiles/Kconfigs that control them. This means not using modular functions/macros for drivers that can never be built as a module. This has been done in quite a lot of other mainline subsystem dirs already.

Using modular infrastructure in non-modules might seem harmless, but some of the downfalls this leads to are:

(1) it is easy to accidentally write unused module_exit and remove code
(2) it can be misleading when reading the source, thinking it can be modular when the Makefile and/or Kconfig prohibit it
(3) it requires the include of the module.h header file which in turn includes nearly everything else, thus adding to CPP overhead.
(4) it gets copied/replicated into other drivers and spreads quickly.

As a data point for #3 above, an empty C file that just includes the module.h header generates over 750kB of CPP output. Repeating the same experiment with init.h and the result is less than 12kB; with export.h it is only about 1/2kB; with both it still is less than 12kB.

Build tested on x86-64 and ARM-64.

Paul.
---

Cc Andrew Lunn <[email protected]>
Cc Gregory CLEMENT <[email protected]>
Cc Kishon Vijay Abraham I <[email protected]>

Paul Gortmaker (3):
phy: make phy-core explicitly non-modular
phy: make phy-mvebu-sata explicitly non-modular
phy: make phy-armada375-usb2 explicitly non-modular

 drivers/phy/marvell/phy-armada375-usb2.c |  8 +-------
 drivers/phy/marvell/phy-mvebu-sata.c     |  9 ++-------
 drivers/phy/phy-core.c                   | 12 +-----------
 3 files changed, 4 insertions(+), 25 deletions(-)
Signature · 1 line
2.7.4