All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] mfd: trivial demodularization of non-modular drivers.
@ 2016-09-12 14:40 ` Paul Gortmaker
  0 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2016-09-12 14:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Boris BREZILLON, Florian Lobmaier,
	Laxman Dewangan, Lee Jones, Maxime Ripard, Mika Westerberg,
	Samuel Ortiz, Sourav Poddar, Thor Thayer, Tony Lindgren,
	linux-omap

I grouped this little series of mfd commits together because of the
common theme of their relatively trivial use of modular infrastructure
in these non-modular drivers.

What that means is there are no orphaned __exit functions to remove;
no unused ".remove" functions linked into the driver struct to be
deleted -- so in the end we have binary equivalence between the
pre-patched code and the post-patched code. Easy to review and low risk.

More specifically - the only thing we are doing here is mapping the
initcall that binds in the driver from the module variant to the
built-in variant ; something that CPP would do for us anyway -- and
then throwing away any MODULE_ tags which are no-ops in non-modular
builds (while preserving any author/desc. info they had in comments).
And in doing that, we can toss the include of module.h in favour of
init.h (asssuming it wasn't included already).

One exception is patch #2; it converts a driver from bool to tristate,
as was asked per the v1 review[1].  This has been build tested, but
I don't have the specific hardware for run time testing.

For anyone new to the underlying goal of this cleanup, 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.  Some of the other 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 like weeds.

Build tested on linux-next for arm, arm64 and x86-64 to ensure no typos
or similar issues crept in.

[1] https://lkml.kernel.org/r/20160705012544.14143-1-paul.gortmaker@windriver.com

Paul.
---

[v1 --> v2: make one driver tristate, add some Ackd-by tags.]

Cc: Boris BREZILLON <boris.brezillon@free-electrons.com>
Cc: Florian Lobmaier <florian.lobmaier@ams.com>
Cc: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Sourav Poddar <sourav.poddar@ti.com>
Cc: Thor Thayer <tthayer@opensource.altera.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org

Paul Gortmaker (6):
  mfd: altera-a10sr: make it explicitly non-modular
  mfd: as3722: convert MFD_AS3722 from bool to tristate
  mfd: intel_msic: Make it explicitly non-modular
  mfd: smsc-ece1099: Make it explicitly non-modular
  mfd: sun6i-prcm: Make it explicitly non-modular
  mfd: twl-core: Make it explicitly non-modular

 drivers/mfd/Kconfig        |  2 +-
 drivers/mfd/altera-a10sr.c | 14 ++++++--------
 drivers/mfd/intel_msic.c   |  9 ++-------
 drivers/mfd/smsc-ece1099.c | 11 ++---------
 drivers/mfd/sun6i-prcm.c   |  8 ++------
 drivers/mfd/twl-core.c     |  9 +--------
 6 files changed, 14 insertions(+), 39 deletions(-)

-- 
2.8.4

^ permalink raw reply	[flat|nested] 19+ messages in thread
* [PATCH 0/6] mfd: trivial demodularization of non-modular drivers.
@ 2016-07-05  1:25 Paul Gortmaker
  2016-07-05  1:25 ` [PATCH 4/6] mfd: smsc-ece1099: Make it explicitly non-modular Paul Gortmaker
  0 siblings, 1 reply; 19+ messages in thread
From: Paul Gortmaker @ 2016-07-05  1:25 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Boris BREZILLON, Florian Lobmaier,
	Laxman Dewangan, Lee Jones, Maxime Ripard, Mika Westerberg,
	Samuel Ortiz, Sourav Poddar, Thor Thayer, Tony Lindgren,
	linux-omap

I grouped this little series of mfd commits together because of the
common theme of their relatively trivial use of modular infrastructure
in these non-modular drivers.

What that means is there are no orphaned __exit functions to remove;
no unused ".remove" functions linked into the driver struct to be
deleted -- so in the end we have binary equivalence between the
pre-patched code and the post-patched code.

Easy to review and low risk as we approach the end of the development
window.  Seems like a good choice for sending at this point in time.

More specifically - the only thing we are doing here is mapping the
initcall that binds in the driver from the module variant to the
built-in variant ; something that CPP would do for us anyway -- and
then throwing away any MODULE_ tags which are no-ops in non-modular
builds (while preserving any author/desc. info they had in comments).
And in doing that, we can toss the include of module.h in favour of
init.h (asssuming it wasn't included already).

For anyone new to the underlying goal of this cleanup, 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.  Some of the other 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 like weeds.

As usual, we can consider making some of these tristate if an author
has strong feelings about extending support into the modular realm,
but I won't be able to run-time test any of that.  And since I can't
even know if a modular use case makes sense, I won't extend the
functionality into the modular realm by default for anything.

Build tested on linux-next for arm, arm64 and x86-64 to ensure no typos
or similar issues crept in.

Paul.
---

Cc: Boris BREZILLON <boris.brezillon@free-electrons.com>
Cc: Florian Lobmaier <florian.lobmaier@ams.com>
Cc: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Sourav Poddar <sourav.poddar@ti.com>
Cc: Thor Thayer <tthayer@opensource.altera.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org

Paul Gortmaker (6):
  mfd: altera-a10sr: make it explicitly non-modular
  mfd: as3722: Make it explicitly non-modular
  mfd: intel_msic: Make it explicitly non-modular
  mfd: smsc-ece1099: Make it explicitly non-modular
  mfd: sun6i-prcm: Make it explicitly non-modular
  mfd: twl-core: Make it explicitly non-modular

 drivers/mfd/altera-a10sr.c | 14 ++++++--------
 drivers/mfd/as3722.c       | 12 ++----------
 drivers/mfd/intel_msic.c   |  9 ++-------
 drivers/mfd/smsc-ece1099.c | 11 ++---------
 drivers/mfd/sun6i-prcm.c   |  8 ++------
 drivers/mfd/twl-core.c     |  9 +--------
 6 files changed, 15 insertions(+), 48 deletions(-)

-- 
2.8.4

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2016-09-13  8:51 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-12 14:40 [PATCH v2 0/6] mfd: trivial demodularization of non-modular drivers Paul Gortmaker
2016-09-12 14:40 ` Paul Gortmaker
2016-09-12 14:40 ` [PATCH 1/6] mfd: altera-a10sr: make it explicitly non-modular Paul Gortmaker
2016-09-13  8:52   ` Lee Jones
2016-09-12 14:40 ` [PATCH 2/6] mfd: as3722: convert MFD_AS3722 from bool to tristate Paul Gortmaker
2016-09-13  8:52   ` Lee Jones
2016-09-12 14:40 ` [PATCH 3/6] mfd: intel_msic: Make it explicitly non-modular Paul Gortmaker
2016-09-13  8:52   ` Lee Jones
2016-09-12 14:40 ` [PATCH 4/6] mfd: smsc-ece1099: " Paul Gortmaker
2016-09-13  8:52   ` Lee Jones
2016-09-12 14:40 ` [PATCH 5/6] mfd: sun6i-prcm: " Paul Gortmaker
2016-09-12 17:43   ` Boris Brezillon
2016-09-13  8:53   ` Lee Jones
2016-09-12 14:40 ` [PATCH 6/6] mfd: twl-core: " Paul Gortmaker
2016-09-12 14:40   ` Paul Gortmaker
2016-09-13  3:26   ` Tony Lindgren
2016-09-13  8:53   ` Lee Jones
  -- strict thread matches above, loose matches on Subject: below --
2016-07-05  1:25 [PATCH 0/6] mfd: trivial demodularization of non-modular drivers Paul Gortmaker
2016-07-05  1:25 ` [PATCH 4/6] mfd: smsc-ece1099: Make it explicitly non-modular Paul Gortmaker
2016-08-05 12:57   ` Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.