From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Gortmaker Subject: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci* Date: Sat, 12 Dec 2015 20:41:47 -0500 Message-ID: <1449970917-12633-1-git-send-email-paul.gortmaker@windriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: linux-kernel@vger.kernel.org Cc: linux-sh@vger.kernel.org, linux-pci@vger.kernel.org, Paul Gortmaker , Thierry Reding , Alexandre Courbot , Pratyush Anand , Michal Simek , Kishon Vijay Abraham I , Murali Karicheri , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , Jason Cooper , Stephen Warren , Simon Horman , linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , Richard Zhu , rfi@lists.rocketboards.org, Ley Foon Tan , Bjorn Helgaas , Lucas Stach List-Id: linux-omap@vger.kernel.org VGhpcyBzZXJpZXMgb2YgY29tbWl0cyBpcyBhIHNsaWNlIG9mIGEgbGFyZ2VyIHByb2plY3QgdG8g ZW5zdXJlCnBlb3BsZSBkb24ndCBoYXZlIGRlYWQgY29kZSBmb3IgbW9kdWxlIHJlbW92YWwgaW4g bm9uLW1vZHVsYXIKZHJpdmVycy4gIE92ZXJhbGwgdGhlcmUgd2FzIHJvdWdobHkgNWsgbGluZXMg b2YgZGVhZCBjb2RlIGluIHRoZQprZXJuZWwgZHVlIHRvIHRoaXMuICBTbyBmYXIgd2UndmUgZml4 ZWQgc2V2ZXJhbCBhcmVhcywgbGlrZSB0dHksCng4NiwgbmV0LCBldGMuIGFuZCB3ZSBjb250aW51 ZSB0byB3b3JrIG9uIG90aGVyIGFyZWFzLgoKVGhlcmUgYXJlIHNldmVyYWwgcmVhc29ucyB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1hcm0t a2VybmVsQGxpc3RzLmluZnJhZGVhZC5vcmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcvbWFp bG1hbi9saXN0aW5mby9saW51eC1hcm0ta2VybmVsCg== From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.windriver.com ([147.11.1.11]:53127 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751918AbbLMBpW (ORCPT ); Sat, 12 Dec 2015 20:45:22 -0500 From: Paul Gortmaker To: CC: Paul Gortmaker , Alexandre Courbot , Bjorn Helgaas , Jason Cooper , Kishon Vijay Abraham I , Ley Foon Tan , Lucas Stach , Michal Simek , Murali Karicheri , Pratyush Anand , Richard Zhu , Simon Horman , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , Stephen Warren , Thierry Reding , Thomas Petazzoni , , , , , , Subject: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci* Date: Sat, 12 Dec 2015 20:41:47 -0500 Message-ID: <1449970917-12633-1-git-send-email-paul.gortmaker@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Sender: linux-pci-owner@vger.kernel.org List-ID: This series of commits is a slice of a larger project to ensure people don't have dead code for module removal in non-modular drivers. Overall there was roughly 5k lines of dead code in the kernel due to this. So far we've fixed several areas, like tty, x86, net, etc. and we continue to work on other areas. There are several reasons to not use module_init for code that can never be built as a module, but the big ones are: (1) it is easy to accidentally code up 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. Here we convert some module_init() calls into device_initcall() and delete any module_exit and remove code that gets orphaned in the process, for an overall net code reduction, which is always welcome. The use of device_initcall ensures that the init function ordering remains unchanged, but one could argue that PCI host code might be more appropriate to be handled under subsys_initcall. Fortunately we can revisit making this extra change at a later date if desired; it does not need to happen now, and we reduce the risk of introducing regressions at this point in time by separating the two changes. Over half of the drivers changed here already explicitly disallowed any unbind operations. For the rest we make them the same, since there is not really any sensible use case to unbind any built-in bus support that I can think of. I have more "avoid module usage in non-modular code" cleanups for the PCI subsystem, but these all have a common theme and it makes for a more maintainer friendly series size to just ask to digest these 1st. Testing was done on linux-next, using an ARCH=arm allmodconfig and then explicitly building the files changed in this series. If desired, I can provide a v4.4-rc4 based branch for merging vs e-mail processing, since I don't think the underlying baseline is overly important for this (largely trivial) series of patches. Paul. --- Cc: Alexandre Courbot Cc: Bjorn Helgaas Cc: Jason Cooper Cc: Kishon Vijay Abraham I Cc: Ley Foon Tan Cc: Lucas Stach Cc: Michal Simek Cc: Murali Karicheri Cc: Pratyush Anand Cc: Richard Zhu Cc: Simon Horman Cc: "Sören Brinkmann" Cc: Stephen Warren Cc: Thierry Reding Cc: Thomas Petazzoni Cc: linux-arm-kernel@lists.infradead.org Cc: linux-omap@vger.kernel.org Cc: linux-pci@vger.kernel.org Cc: linux-sh@vger.kernel.org Cc: linux-tegra@vger.kernel.org Cc: rfi@lists.rocketboards.org Paul Gortmaker (10): drivers/pci: make host/pci-imx6.c driver explicitly non-modular drivers/pci: make host/pcie-spear13xx.c driver explicitly non-modular drivers/pci: make host/pci-mvebu.c explicitly non-modular drivers/pci: make host/pci-dra7xx.c explicitly non-modular drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular drivers/pci: make host/pci-tegra.c explicitly non-modular drivers/pci: make host/pcie-rcar.c explicitly non-modular drivers/pci: make host/pcie-xilinx.c explicitly non-modular drivers/pci: make host/pci-keystone.c explicitly non-modular drivers/pci: make host/pcie-altera.c explicitly non-modular drivers/pci/host/pci-dra7xx.c | 31 +++-------------------- drivers/pci/host/pci-imx6.c | 12 +++------ drivers/pci/host/pci-keystone.c | 21 +++------------- drivers/pci/host/pci-mvebu.c | 11 +++----- drivers/pci/host/pci-rcar-gen2.c | 12 +++------ drivers/pci/host/pci-tegra.c | 11 +++----- drivers/pci/host/pcie-altera.c | 12 ++++----- drivers/pci/host/pcie-rcar.c | 11 +++----- drivers/pci/host/pcie-spear13xx.c | 10 +++----- drivers/pci/host/pcie-xilinx.c | 53 ++------------------------------------- 10 files changed, 35 insertions(+), 149 deletions(-) -- 2.6.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Gortmaker Date: Sun, 13 Dec 2015 01:41:47 +0000 Subject: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci* Message-Id: <1449970917-12633-1-git-send-email-paul.gortmaker@windriver.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-arm-kernel@lists.infradead.org This series of commits is a slice of a larger project to ensure people don't have dead code for module removal in non-modular drivers. Overall there was roughly 5k lines of dead code in the kernel due to this. So far we've fixed several areas, like tty, x86, net, etc. and we continue to work on other areas. There are several reasons to not use module_init for code that can never be built as a module, but the big ones are: (1) it is easy to accidentally code up 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. Here we convert some module_init() calls into device_initcall() and delete any module_exit and remove code that gets orphaned in the process, for an overall net code reduction, which is always welcome. The use of device_initcall ensures that the init function ordering remains unchanged, but one could argue that PCI host code might be more appropriate to be handled under subsys_initcall. Fortunately we can revisit making this extra change at a later date if desired; it does not need to happen now, and we reduce the risk of introducing regressions at this point in time by separating the two changes. Over half of the drivers changed here already explicitly disallowed any unbind operations. For the rest we make them the same, since there is not really any sensible use case to unbind any built-in bus support that I can think of. I have more "avoid module usage in non-modular code" cleanups for the PCI subsystem, but these all have a common theme and it makes for a more maintainer friendly series size to just ask to digest these 1st. Testing was done on linux-next, using an ARCH=3Darm allmodconfig and then explicitly building the files changed in this series. If desired, I can provide a v4.4-rc4 based branch for merging vs e-mail processing, since I don't think the underlying baseline is overly important for this (largely trivial) series of patches. Paul. --- Cc: Alexandre Courbot Cc: Bjorn Helgaas Cc: Jason Cooper Cc: Kishon Vijay Abraham I Cc: Ley Foon Tan Cc: Lucas Stach Cc: Michal Simek Cc: Murali Karicheri Cc: Pratyush Anand Cc: Richard Zhu Cc: Simon Horman Cc: "S=C3=B6ren Brinkmann" Cc: Stephen Warren Cc: Thierry Reding Cc: Thomas Petazzoni Cc: linux-arm-kernel@lists.infradead.org Cc: linux-omap@vger.kernel.org Cc: linux-pci@vger.kernel.org Cc: linux-sh@vger.kernel.org Cc: linux-tegra@vger.kernel.org Cc: rfi@lists.rocketboards.org Paul Gortmaker (10): drivers/pci: make host/pci-imx6.c driver explicitly non-modular drivers/pci: make host/pcie-spear13xx.c driver explicitly non-modular drivers/pci: make host/pci-mvebu.c explicitly non-modular drivers/pci: make host/pci-dra7xx.c explicitly non-modular drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular drivers/pci: make host/pci-tegra.c explicitly non-modular drivers/pci: make host/pcie-rcar.c explicitly non-modular drivers/pci: make host/pcie-xilinx.c explicitly non-modular drivers/pci: make host/pci-keystone.c explicitly non-modular drivers/pci: make host/pcie-altera.c explicitly non-modular drivers/pci/host/pci-dra7xx.c | 31 +++-------------------- drivers/pci/host/pci-imx6.c | 12 +++------ drivers/pci/host/pci-keystone.c | 21 +++------------- drivers/pci/host/pci-mvebu.c | 11 +++----- drivers/pci/host/pci-rcar-gen2.c | 12 +++------ drivers/pci/host/pci-tegra.c | 11 +++----- drivers/pci/host/pcie-altera.c | 12 ++++----- drivers/pci/host/pcie-rcar.c | 11 +++----- drivers/pci/host/pcie-spear13xx.c | 10 +++----- drivers/pci/host/pcie-xilinx.c | 53 ++---------------------------------= ---- 10 files changed, 35 insertions(+), 149 deletions(-) --=20 2.6.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: paul.gortmaker@windriver.com (Paul Gortmaker) Date: Sat, 12 Dec 2015 20:41:47 -0500 Subject: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci* Message-ID: <1449970917-12633-1-git-send-email-paul.gortmaker@windriver.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org This series of commits is a slice of a larger project to ensure people don't have dead code for module removal in non-modular drivers. Overall there was roughly 5k lines of dead code in the kernel due to this. So far we've fixed several areas, like tty, x86, net, etc. and we continue to work on other areas. There are several reasons to not use module_init for code that can never be built as a module, but the big ones are: (1) it is easy to accidentally code up 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. Here we convert some module_init() calls into device_initcall() and delete any module_exit and remove code that gets orphaned in the process, for an overall net code reduction, which is always welcome. The use of device_initcall ensures that the init function ordering remains unchanged, but one could argue that PCI host code might be more appropriate to be handled under subsys_initcall. Fortunately we can revisit making this extra change at a later date if desired; it does not need to happen now, and we reduce the risk of introducing regressions at this point in time by separating the two changes. Over half of the drivers changed here already explicitly disallowed any unbind operations. For the rest we make them the same, since there is not really any sensible use case to unbind any built-in bus support that I can think of. I have more "avoid module usage in non-modular code" cleanups for the PCI subsystem, but these all have a common theme and it makes for a more maintainer friendly series size to just ask to digest these 1st. Testing was done on linux-next, using an ARCH=arm allmodconfig and then explicitly building the files changed in this series. If desired, I can provide a v4.4-rc4 based branch for merging vs e-mail processing, since I don't think the underlying baseline is overly important for this (largely trivial) series of patches. Paul. --- Cc: Alexandre Courbot Cc: Bjorn Helgaas Cc: Jason Cooper Cc: Kishon Vijay Abraham I Cc: Ley Foon Tan Cc: Lucas Stach Cc: Michal Simek Cc: Murali Karicheri Cc: Pratyush Anand Cc: Richard Zhu Cc: Simon Horman Cc: "S?ren Brinkmann" Cc: Stephen Warren Cc: Thierry Reding Cc: Thomas Petazzoni Cc: linux-arm-kernel at lists.infradead.org Cc: linux-omap at vger.kernel.org Cc: linux-pci at vger.kernel.org Cc: linux-sh at vger.kernel.org Cc: linux-tegra at vger.kernel.org Cc: rfi at lists.rocketboards.org Paul Gortmaker (10): drivers/pci: make host/pci-imx6.c driver explicitly non-modular drivers/pci: make host/pcie-spear13xx.c driver explicitly non-modular drivers/pci: make host/pci-mvebu.c explicitly non-modular drivers/pci: make host/pci-dra7xx.c explicitly non-modular drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular drivers/pci: make host/pci-tegra.c explicitly non-modular drivers/pci: make host/pcie-rcar.c explicitly non-modular drivers/pci: make host/pcie-xilinx.c explicitly non-modular drivers/pci: make host/pci-keystone.c explicitly non-modular drivers/pci: make host/pcie-altera.c explicitly non-modular drivers/pci/host/pci-dra7xx.c | 31 +++-------------------- drivers/pci/host/pci-imx6.c | 12 +++------ drivers/pci/host/pci-keystone.c | 21 +++------------- drivers/pci/host/pci-mvebu.c | 11 +++----- drivers/pci/host/pci-rcar-gen2.c | 12 +++------ drivers/pci/host/pci-tegra.c | 11 +++----- drivers/pci/host/pcie-altera.c | 12 ++++----- drivers/pci/host/pcie-rcar.c | 11 +++----- drivers/pci/host/pcie-spear13xx.c | 10 +++----- drivers/pci/host/pcie-xilinx.c | 53 ++------------------------------------- 10 files changed, 35 insertions(+), 149 deletions(-) -- 2.6.1