From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: linux-kernel@vger.kernel.org
Cc: Alexey Charkov <alchark@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>, Tony Prisk <linux@prisktech.co.nz>,
linux-serial@vger.kernel.org
Subject: Re: [PATCH 0/3] serial: remove modular code from a few more non-modular drivers
Date: Tue, 21 Jun 2016 01:30:12 -0400 [thread overview]
Message-ID: <20160621053012.GM12567@windriver.com> (raw)
In-Reply-To: <20160620225505.7320-1-paul.gortmaker@windriver.com>
[[PATCH 0/3] serial: remove modular code from a few more non-modular drivers] On 20/06/2016 (Mon 18:55) Paul Gortmaker wrote:
> 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.
>
> We have already fixed a bunch of these in drivers/tty already, so there
> is really nothing new to see here (at least for the serial maintainers).
Apologies in advance to anyone who is trying to find these patches via
an archive of linux-kernel or linux-serial ; it seems that we hit a
window where a glitch at vger.kernel.org was rejecting incoming mails.
P.
--
>
> Changes seen here cover the following categories:
>
> -just replacement of modular macros with their non-modular
> equivalents that CPP would have inserted anyway
>
> -the removal of including module.h ; replaced with init.h
> as required based on whether the file already had it.
>
> -the removal of any/all unused/orphaned __exit functions
> that would never be called/exercised.
>
> -the removal of any ".remove" functions that were hooked into
> the driver struct. This ".remove" function would of
> course not be called from the __exit function since that was
> never run. However in theory, someone could have triggered it
> via sysfs unbind, even though there isn't a sensible use case
> for doing so. So to cover that possibility, we've also disabled
> sysfs unbind in the driver.
>
> In doing so we get rid of ~70 lines of dead code across 3 drivers.
>
> There are no initcall level changes here; everything was at the level
> of device_initcall and remains so, by using the builtin equivalents.
>
> Build tested for arm(2) and m32r(1) on the linux-next tree from today
> to ensure no silly typos crept in.
>
> If there is a desire for any of these to be modular, we can definitely
> consider that, but by default the changes here keep the code consistent
> with existing behaviour. Thus I do not expand functionality into the
> modular realm that I can't run time test, or even know if the modular
> instance has a sensible modular use case.
>
> Paul.
> ---
>
> Cc: Alexey Charkov <alchark@gmail.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Jiri Slaby <jslaby@suse.com>
> Cc: Tony Prisk <linux@prisktech.co.nz>
> Cc: linux-serial@vger.kernel.org
>
> Paul Gortmaker (3):
> serial: pxa: make it explicitly non-modular
> serial: vt8500_serial: make it explicitly non-modular
> serial: m32r_sio: make it explicitly non-modular
>
> drivers/tty/serial/m32r_sio.c | 18 +-----------------
> drivers/tty/serial/pxa.c | 31 +++----------------------------
> drivers/tty/serial/vt8500_serial.c | 30 ++----------------------------
> 3 files changed, 6 insertions(+), 73 deletions(-)
>
> --
> 2.8.4
WARNING: multiple messages have this Message-ID (diff)
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <linux-kernel@vger.kernel.org>
Cc: Alexey Charkov <alchark@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>, Tony Prisk <linux@prisktech.co.nz>,
<linux-serial@vger.kernel.org>
Subject: Re: [PATCH 0/3] serial: remove modular code from a few more non-modular drivers
Date: Tue, 21 Jun 2016 01:30:12 -0400 [thread overview]
Message-ID: <20160621053012.GM12567@windriver.com> (raw)
In-Reply-To: <20160620225505.7320-1-paul.gortmaker@windriver.com>
[[PATCH 0/3] serial: remove modular code from a few more non-modular drivers] On 20/06/2016 (Mon 18:55) Paul Gortmaker wrote:
> 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.
>
> We have already fixed a bunch of these in drivers/tty already, so there
> is really nothing new to see here (at least for the serial maintainers).
Apologies in advance to anyone who is trying to find these patches via
an archive of linux-kernel or linux-serial ; it seems that we hit a
window where a glitch at vger.kernel.org was rejecting incoming mails.
P.
--
>
> Changes seen here cover the following categories:
>
> -just replacement of modular macros with their non-modular
> equivalents that CPP would have inserted anyway
>
> -the removal of including module.h ; replaced with init.h
> as required based on whether the file already had it.
>
> -the removal of any/all unused/orphaned __exit functions
> that would never be called/exercised.
>
> -the removal of any ".remove" functions that were hooked into
> the driver struct. This ".remove" function would of
> course not be called from the __exit function since that was
> never run. However in theory, someone could have triggered it
> via sysfs unbind, even though there isn't a sensible use case
> for doing so. So to cover that possibility, we've also disabled
> sysfs unbind in the driver.
>
> In doing so we get rid of ~70 lines of dead code across 3 drivers.
>
> There are no initcall level changes here; everything was at the level
> of device_initcall and remains so, by using the builtin equivalents.
>
> Build tested for arm(2) and m32r(1) on the linux-next tree from today
> to ensure no silly typos crept in.
>
> If there is a desire for any of these to be modular, we can definitely
> consider that, but by default the changes here keep the code consistent
> with existing behaviour. Thus I do not expand functionality into the
> modular realm that I can't run time test, or even know if the modular
> instance has a sensible modular use case.
>
> Paul.
> ---
>
> Cc: Alexey Charkov <alchark@gmail.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Jiri Slaby <jslaby@suse.com>
> Cc: Tony Prisk <linux@prisktech.co.nz>
> Cc: linux-serial@vger.kernel.org
>
> Paul Gortmaker (3):
> serial: pxa: make it explicitly non-modular
> serial: vt8500_serial: make it explicitly non-modular
> serial: m32r_sio: make it explicitly non-modular
>
> drivers/tty/serial/m32r_sio.c | 18 +-----------------
> drivers/tty/serial/pxa.c | 31 +++----------------------------
> drivers/tty/serial/vt8500_serial.c | 30 ++----------------------------
> 3 files changed, 6 insertions(+), 73 deletions(-)
>
> --
> 2.8.4
next prev parent reply other threads:[~2016-06-21 5:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20160620225505.7320-1-paul.gortmaker@windriver.com>
2016-06-20 22:55 ` [PATCH 1/3] serial: pxa: make it explicitly non-modular Paul Gortmaker
2016-06-20 22:55 ` Paul Gortmaker
2016-06-20 22:55 ` [PATCH 2/3] serial: vt8500_serial: " Paul Gortmaker
2016-06-20 22:55 ` Paul Gortmaker
2016-06-20 22:55 ` [PATCH 3/3] serial: m32r_sio: " Paul Gortmaker
2016-06-20 22:55 ` Paul Gortmaker
2016-06-21 5:30 ` Paul Gortmaker [this message]
2016-06-21 5:30 ` [PATCH 0/3] serial: remove modular code from a few more non-modular drivers Paul Gortmaker
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=20160621053012.GM12567@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=alchark@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux@prisktech.co.nz \
/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.