[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1544402090-30970-1-git-send-email-paul.gortmaker@windriver.com>
Date: Sun, 9 Dec 2018 19:34:47 -0500
From: Paul Gortmaker <paul.gortmaker@...driver.com>
To: Kishon Vijay Abraham I <kishon@...com>
CC: <linux-kernel@...r.kernel.org>,
Paul Gortmaker <paul.gortmaker@...driver.com>,
Andrew Lunn <andrew@...n.ch>,
Gregory CLEMENT <gregory.clement@...e-electrons.com>
Subject: [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 <andrew@...n.ch>
Cc: Gregory CLEMENT <gregory.clement@...e-electrons.com>
Cc: Kishon Vijay Abraham I <kishon@...com>
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(-)
--
2.7.4
Powered by blists - more mailing lists