All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <linux-kernel@vger.kernel.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
	Andrzej Hajda <a.hajda@samsung.com>,
	Anton Blanchard <anton@samba.org>, Arnd Bergmann <arnd@arndb.de>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Christian Krafft <krafft@de.ibm.com>,
	Hari Bathini <hbathini@linux.vnet.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nathan Fontenot <nfont@linux.vnet.ibm.com>,
	Paul Mackerras <paulus@samba.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	<linux-pm@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>
Subject: [PATCH 0/3] powerpc: remove unused modular code from non-modular drivers
Date: Sun, 27 Mar 2016 18:08:14 -0400	[thread overview]
Message-ID: <1459116497-19991-1-git-send-email-paul.gortmaker@windriver.com> (raw)

My ongoing audit looking for non-modular code that needlessly uses
modular macros (vs. built-in equivalents) and/or has dead code
relating to module unloading that can never be executed led to the
creation of these three powerpc related commits.

One is of the trivial kind, where we substitute in the non-modular
versions that CPP would have put in place anyway, resulting in no
actual changes, even at the binary output level.

The other two are almost as trivial.  In addition to the above, we
toss out the __exit function registered by module_exit, since that
will never get called for non modular code/drivers.

For anyone new to the underlying goal of this cleanup, we are trying to
not use module support for code that can never be built as a module since:

 (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 code and spreads like weeds.

Build tested on v4.6-rc1 to ensure no silly typos that would break
compilation crept in.

---
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Christian Krafft <krafft@de.ibm.com>
Cc: Hari Bathini <hbathini@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org

Paul Gortmaker (3):
  powerpc: make cell/spu_base.c explicitly non-modular
  powerpc: make kernel/nvram_64.c explicitly non-modular
  drivers/cpufreq: make ppc_cbe_cpufreq_pmi driver explicitly
    non-modular

 arch/powerpc/kernel/nvram_64.c         | 12 +-----------
 arch/powerpc/platforms/cell/spu_base.c |  7 ++-----
 drivers/cpufreq/ppc_cbe_cpufreq_pmi.c  | 15 ++-------------
 3 files changed, 5 insertions(+), 29 deletions(-)

-- 
2.6.1

WARNING: multiple messages have this Message-ID (diff)
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: linux-kernel@vger.kernel.org
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
	Andrzej Hajda <a.hajda@samsung.com>,
	Anton Blanchard <anton@samba.org>, Arnd Bergmann <arnd@arndb.de>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Christian Krafft <krafft@de.ibm.com>,
	Hari Bathini <hbathini@linux.vnet.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nathan Fontenot <nfont@linux.vnet.ibm.com>,
	Paul Mackerras <paulus@samba.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 0/3] powerpc: remove unused modular code from non-modular drivers
Date: Sun, 27 Mar 2016 18:08:14 -0400	[thread overview]
Message-ID: <1459116497-19991-1-git-send-email-paul.gortmaker@windriver.com> (raw)

My ongoing audit looking for non-modular code that needlessly uses
modular macros (vs. built-in equivalents) and/or has dead code
relating to module unloading that can never be executed led to the
creation of these three powerpc related commits.

One is of the trivial kind, where we substitute in the non-modular
versions that CPP would have put in place anyway, resulting in no
actual changes, even at the binary output level.

The other two are almost as trivial.  In addition to the above, we
toss out the __exit function registered by module_exit, since that
will never get called for non modular code/drivers.

For anyone new to the underlying goal of this cleanup, we are trying to
not use module support for code that can never be built as a module since:

 (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 code and spreads like weeds.

Build tested on v4.6-rc1 to ensure no silly typos that would break
compilation crept in.

---
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Christian Krafft <krafft@de.ibm.com>
Cc: Hari Bathini <hbathini@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org

Paul Gortmaker (3):
  powerpc: make cell/spu_base.c explicitly non-modular
  powerpc: make kernel/nvram_64.c explicitly non-modular
  drivers/cpufreq: make ppc_cbe_cpufreq_pmi driver explicitly
    non-modular

 arch/powerpc/kernel/nvram_64.c         | 12 +-----------
 arch/powerpc/platforms/cell/spu_base.c |  7 ++-----
 drivers/cpufreq/ppc_cbe_cpufreq_pmi.c  | 15 ++-------------
 3 files changed, 5 insertions(+), 29 deletions(-)

-- 
2.6.1

             reply	other threads:[~2016-03-27 22:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-27 22:08 Paul Gortmaker [this message]
2016-03-27 22:08 ` [PATCH 0/3] powerpc: remove unused modular code from non-modular drivers Paul Gortmaker
2016-03-27 22:08 ` [PATCH 1/3] powerpc: make cell/spu_base.c explicitly non-modular Paul Gortmaker
2016-04-11 12:35   ` [1/3] " Michael Ellerman
2016-03-27 22:08 ` [PATCH 2/3] powerpc: make kernel/nvram_64.c " Paul Gortmaker
2016-03-28 14:22   ` Nathan Fontenot
2016-04-11 12:35   ` [2/3] " Michael Ellerman
2016-03-27 22:08 ` [PATCH 3/3] drivers/cpufreq: make ppc_cbe_cpufreq_pmi driver " Paul Gortmaker
2016-03-27 22:08   ` Paul Gortmaker
2016-03-28  2:33   ` Viresh Kumar
2016-04-11 12:35   ` [3/3] " Michael Ellerman
2016-04-11 12:35     ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1459116497-19991-1-git-send-email-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=a.hajda@samsung.com \
    --cc=anton@samba.org \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=hbathini@linux.vnet.ibm.com \
    --cc=krafft@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=nfont@linux.vnet.ibm.com \
    --cc=paulus@samba.org \
    --cc=rjw@rjwysocki.net \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.