Skip to content

wdt: clean up unused modular infrastructure

Paul Gortmaker linux-watchdog openbmc 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5watchdog: rtd119x: drop unused module.h includedrivers/watchdog/rtd119x_wdt.c+0 -11 reply
2/5watchdog: watchdog_core: make it explicitly non-modulardrivers/watchdog/watchdog_core.c+1 -145 replies
3/5watchdog: npcm: make it explicitly non-modulardrivers/watchdog/npcm_wdt.c+6 -72 replies
4/5watchdog: intel_scu: make it explicitly non-modulardrivers/watchdog/intel_scu_watchdog.c+0 -181 reply
5/5watchdog: coh901327: make it explicitly non-modulardrivers/watchdog/coh901327_wdt.c+4 -202 replies

Reviews trailers per patch

3 of 5 patches have a Reviewed-by or Acked-by.

PatchLinus WalleijGuenter Roeck
1/5R-b
2/5
3/5
4/5R-b
5/5R-b R-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/5] wdt: clean up unused modular infrastructure

People can embed modular includes and modular exit functions into code that never use any of it, and they won't get any errors or warnings.

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/remove code
(2) it can be misleading when reading the source, thinking a driver can be modular when the Makefile and/or Kconfig prohibit it
(3) an unused include of the module.h header file will in turn include nearly everything else; adding a lot to CPP overhead.
(4) it gets copied/replicated into other drivers and can spread.

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.

Here, In this series, we do what has been done for other subsystems, like, net, x86, mfd, iommu.... and audit for uses of modular infrastructure inside code that currently can't be built as a module.

As always, the option exists for driver authors to convert their code to tristate, if there is a valid use case for it to be so. But since I don't have the context for each driver to know if such a use case exists, I limit myself to simply removing the unused code in order to make the driver consistent with the Makefile/Kconfig settings that control it.

Paul.

---

Cc Benjamin Fair <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Nancy Yuen <[email protected]>
Cc Patrick Venture <[email protected]>
Cc Tali Perry <[email protected]>
Cc Tomer Maimon <[email protected]>
Cc Wim Van Sebroeck <[email protected]>
Cc Wim Van Sebroeck <[email protected]>

Paul Gortmaker (5):
watchdog: rtd119x: drop unused module.h include
watchdog: watchdog_core: make it explicitly non-modular
watchdog: npcm: make it explicitly non-modular
watchdog: intel_scu: make it explicitly non-modular
watchdog: coh901327: make it explicitly non-modular

 drivers/watchdog/coh901327_wdt.c      | 24 ++++--------------------
 drivers/watchdog/intel_scu_watchdog.c | 18 ------------------
 drivers/watchdog/npcm_wdt.c           | 13 ++++++-------
 drivers/watchdog/rtd119x_wdt.c        |  1 -
 drivers/watchdog/watchdog_core.c      | 15 +--------------
 5 files changed, 11 insertions(+), 60 deletions(-)
Signature · 1 line
2.7.4