Re: [PATCH] mips: audit and remove any unnecessary uses of module.h

2017-02-14 Thread James Hogan
On Tue, Feb 14, 2017 at 01:59:34PM -0500, Paul Gortmaker wrote:
> [Re: [PATCH] mips: audit and remove any unnecessary uses of module.h] On 
> 14/02/2017 (Tue 10:10) James Hogan wrote:
> 
> > On Sat, Jan 28, 2017 at 09:05:57PM -0500, Paul Gortmaker wrote:
> > > Historically a lot of these existed because we did not have
> > > a distinction between what was modular code and what was providing
> > > support to modules via EXPORT_SYMBOL and friends.  That changed
> > > when we forked out support for the latter into the export.h file.
> > > 
> > > This means we should be able to reduce the usage of module.h
> > > in code that is obj-y Makefile or bool Kconfig.  In the case of
> > > some code where it is modular, we can extend that to also include
> > > files that are building basic support functionality but not related
> > > to loading or registering the final module; such files also have
> > > no need whatsoever for module.h
> > > 
> > > The advantage in removing such instances is that module.h itself
> > > sources about 15 other headers; adding significantly to what we feed
> > > cpp, and it can obscure what headers we are effectively using.
> > > 
> > > Since module.h might have been the implicit source for init.h
> > > (for __init) and for export.h (for EXPORT_SYMBOL) we consider each
> > > instance for the presence of either and replace/add as needed.
> > > 
> > > Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> > > 
> > > Build coverage of all the mips defconfigs revealed the module.h
> > > header was masking a couple of implicit include instances, so
> > > we add the appropriate headers there.
> > > 
> > > Cc: David Daney <david.da...@cavium.com>
> > > Cc: John Crispin <j...@phrozen.org>
> > > Cc: Ralf Baechle <r...@linux-mips.org>
> > > Cc: "Steven J. Hill" <steven.h...@cavium.com>
> > > Cc: linux-m...@linux-mips.org
> > > Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com>
> > 
> > Applied (with a couple of tweaks to preserve existing sort order)
> 
> Thanks -- were you hoping for xmas tree order (string length) or
> alphabetical sort?  I'll make a mental note to check that for any future
> MIPS patches I have.

Heh, I never noticed xmas tree sort order before.

Consistency within a file is probably all we can hope for since the
whole tree is so inconsistent, but its not like it matters that much :)

Cheers
James

> 
> P.
> --
> 
> > 
> > Thanks
> > James
> > 
> > > ---
> > > 
> > > [I had this split along platform lines into 17 separate commits, but
> > >  when I realized there were only 3 platform specific maintainers called
> > >  out, I thought that was probably overkill.  If the split version is
> > >  desired, let me know.
> > > 
> > >  Also, this is against v4.10-rc5.  The same patch against linux-next
> > >  will have a trivial conflict in xway dma.c due to a spinlock.h
> > >  addition there. ]
> > > 
> > >  arch/mips/alchemy/common/dbdma.c   | 2 +-
> > >  arch/mips/alchemy/common/dma.c | 2 +-
> > >  arch/mips/alchemy/common/gpiolib.c | 1 -
> > >  arch/mips/alchemy/common/prom.c| 1 -
> > >  arch/mips/alchemy/common/usb.c | 2 +-
> > >  arch/mips/alchemy/common/vss.c | 2 +-
> > >  arch/mips/alchemy/devboards/bcsr.c | 3 ++-
> > >  arch/mips/ar7/clock.c  | 2 +-
> > >  arch/mips/ar7/gpio.c   | 3 ++-
> > >  arch/mips/ar7/memory.c | 1 -
> > >  arch/mips/ar7/platform.c   | 1 -
> > >  arch/mips/ar7/prom.c   | 2 +-
> > >  arch/mips/ath79/clock.c| 1 -
> > >  arch/mips/ath79/common.c   | 2 +-
> > >  arch/mips/bcm63xx/clk.c| 3 ++-
> > >  arch/mips/bcm63xx/cpu.c| 2 +-
> > >  arch/mips/bcm63xx/cs.c | 3 ++-
> > >  arch/mips/bcm63xx/gpio.c   | 2 +-
> > >  arch/mips/bcm63xx/irq.c| 1 -
> > >  arch/mips/bcm63xx/reset.c  | 3 ++-
> > >  arch/mips/bcm63xx/timer.c 

Re: [PATCH] mips: audit and remove any unnecessary uses of module.h

2017-02-14 Thread James Hogan
On Tue, Feb 14, 2017 at 01:59:34PM -0500, Paul Gortmaker wrote:
> [Re: [PATCH] mips: audit and remove any unnecessary uses of module.h] On 
> 14/02/2017 (Tue 10:10) James Hogan wrote:
> 
> > On Sat, Jan 28, 2017 at 09:05:57PM -0500, Paul Gortmaker wrote:
> > > Historically a lot of these existed because we did not have
> > > a distinction between what was modular code and what was providing
> > > support to modules via EXPORT_SYMBOL and friends.  That changed
> > > when we forked out support for the latter into the export.h file.
> > > 
> > > This means we should be able to reduce the usage of module.h
> > > in code that is obj-y Makefile or bool Kconfig.  In the case of
> > > some code where it is modular, we can extend that to also include
> > > files that are building basic support functionality but not related
> > > to loading or registering the final module; such files also have
> > > no need whatsoever for module.h
> > > 
> > > The advantage in removing such instances is that module.h itself
> > > sources about 15 other headers; adding significantly to what we feed
> > > cpp, and it can obscure what headers we are effectively using.
> > > 
> > > Since module.h might have been the implicit source for init.h
> > > (for __init) and for export.h (for EXPORT_SYMBOL) we consider each
> > > instance for the presence of either and replace/add as needed.
> > > 
> > > Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> > > 
> > > Build coverage of all the mips defconfigs revealed the module.h
> > > header was masking a couple of implicit include instances, so
> > > we add the appropriate headers there.
> > > 
> > > Cc: David Daney 
> > > Cc: John Crispin 
> > > Cc: Ralf Baechle 
> > > Cc: "Steven J. Hill" 
> > > Cc: linux-m...@linux-mips.org
> > > Signed-off-by: Paul Gortmaker 
> > 
> > Applied (with a couple of tweaks to preserve existing sort order)
> 
> Thanks -- were you hoping for xmas tree order (string length) or
> alphabetical sort?  I'll make a mental note to check that for any future
> MIPS patches I have.

Heh, I never noticed xmas tree sort order before.

Consistency within a file is probably all we can hope for since the
whole tree is so inconsistent, but its not like it matters that much :)

Cheers
James

> 
> P.
> --
> 
> > 
> > Thanks
> > James
> > 
> > > ---
> > > 
> > > [I had this split along platform lines into 17 separate commits, but
> > >  when I realized there were only 3 platform specific maintainers called
> > >  out, I thought that was probably overkill.  If the split version is
> > >  desired, let me know.
> > > 
> > >  Also, this is against v4.10-rc5.  The same patch against linux-next
> > >  will have a trivial conflict in xway dma.c due to a spinlock.h
> > >  addition there. ]
> > > 
> > >  arch/mips/alchemy/common/dbdma.c   | 2 +-
> > >  arch/mips/alchemy/common/dma.c | 2 +-
> > >  arch/mips/alchemy/common/gpiolib.c | 1 -
> > >  arch/mips/alchemy/common/prom.c| 1 -
> > >  arch/mips/alchemy/common/usb.c | 2 +-
> > >  arch/mips/alchemy/common/vss.c | 2 +-
> > >  arch/mips/alchemy/devboards/bcsr.c | 3 ++-
> > >  arch/mips/ar7/clock.c  | 2 +-
> > >  arch/mips/ar7/gpio.c   | 3 ++-
> > >  arch/mips/ar7/memory.c | 1 -
> > >  arch/mips/ar7/platform.c   | 1 -
> > >  arch/mips/ar7/prom.c   | 2 +-
> > >  arch/mips/ath79/clock.c| 1 -
> > >  arch/mips/ath79/common.c   | 2 +-
> > >  arch/mips/bcm63xx/clk.c| 3 ++-
> > >  arch/mips/bcm63xx/cpu.c| 2 +-
> > >  arch/mips/bcm63xx/cs.c | 3 ++-
> > >  arch/mips/bcm63xx/gpio.c   | 2 +-
> > >  arch/mips/bcm63xx/irq.c| 1 -
> > >  arch/mips/bcm63xx/reset.c  | 3 ++-
> > >  arch/mips/bcm63xx/timer.c  | 3 ++-
> > >  arch/mips/cavium-octeon/crypto/octeon-crypto.c | 2 +-
> > >  arc

Re: [PATCH] mips: audit and remove any unnecessary uses of module.h

2017-02-14 Thread Paul Gortmaker
[Re: [PATCH] mips: audit and remove any unnecessary uses of module.h] On 
14/02/2017 (Tue 10:10) James Hogan wrote:

> On Sat, Jan 28, 2017 at 09:05:57PM -0500, Paul Gortmaker wrote:
> > Historically a lot of these existed because we did not have
> > a distinction between what was modular code and what was providing
> > support to modules via EXPORT_SYMBOL and friends.  That changed
> > when we forked out support for the latter into the export.h file.
> > 
> > This means we should be able to reduce the usage of module.h
> > in code that is obj-y Makefile or bool Kconfig.  In the case of
> > some code where it is modular, we can extend that to also include
> > files that are building basic support functionality but not related
> > to loading or registering the final module; such files also have
> > no need whatsoever for module.h
> > 
> > The advantage in removing such instances is that module.h itself
> > sources about 15 other headers; adding significantly to what we feed
> > cpp, and it can obscure what headers we are effectively using.
> > 
> > Since module.h might have been the implicit source for init.h
> > (for __init) and for export.h (for EXPORT_SYMBOL) we consider each
> > instance for the presence of either and replace/add as needed.
> > 
> > Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> > 
> > Build coverage of all the mips defconfigs revealed the module.h
> > header was masking a couple of implicit include instances, so
> > we add the appropriate headers there.
> > 
> > Cc: David Daney <david.da...@cavium.com>
> > Cc: John Crispin <j...@phrozen.org>
> > Cc: Ralf Baechle <r...@linux-mips.org>
> > Cc: "Steven J. Hill" <steven.h...@cavium.com>
> > Cc: linux-m...@linux-mips.org
> > Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com>
> 
> Applied (with a couple of tweaks to preserve existing sort order)

Thanks -- were you hoping for xmas tree order (string length) or
alphabetical sort?  I'll make a mental note to check that for any future
MIPS patches I have.

P.
--

> 
> Thanks
> James
> 
> > ---
> > 
> > [I had this split along platform lines into 17 separate commits, but
> >  when I realized there were only 3 platform specific maintainers called
> >  out, I thought that was probably overkill.  If the split version is
> >  desired, let me know.
> > 
> >  Also, this is against v4.10-rc5.  The same patch against linux-next
> >  will have a trivial conflict in xway dma.c due to a spinlock.h
> >  addition there. ]
> > 
> >  arch/mips/alchemy/common/dbdma.c   | 2 +-
> >  arch/mips/alchemy/common/dma.c | 2 +-
> >  arch/mips/alchemy/common/gpiolib.c | 1 -
> >  arch/mips/alchemy/common/prom.c| 1 -
> >  arch/mips/alchemy/common/usb.c | 2 +-
> >  arch/mips/alchemy/common/vss.c | 2 +-
> >  arch/mips/alchemy/devboards/bcsr.c | 3 ++-
> >  arch/mips/ar7/clock.c  | 2 +-
> >  arch/mips/ar7/gpio.c   | 3 ++-
> >  arch/mips/ar7/memory.c | 1 -
> >  arch/mips/ar7/platform.c   | 1 -
> >  arch/mips/ar7/prom.c   | 2 +-
> >  arch/mips/ath79/clock.c| 1 -
> >  arch/mips/ath79/common.c   | 2 +-
> >  arch/mips/bcm63xx/clk.c| 3 ++-
> >  arch/mips/bcm63xx/cpu.c| 2 +-
> >  arch/mips/bcm63xx/cs.c | 3 ++-
> >  arch/mips/bcm63xx/gpio.c   | 2 +-
> >  arch/mips/bcm63xx/irq.c| 1 -
> >  arch/mips/bcm63xx/reset.c  | 3 ++-
> >  arch/mips/bcm63xx/timer.c  | 3 ++-
> >  arch/mips/cavium-octeon/crypto/octeon-crypto.c | 2 +-
> >  arch/mips/cavium-octeon/executive/cvmx-bootmem.c   | 2 +-
> >  arch/mips/cavium-octeon/executive/cvmx-helper-errata.c | 2 +-
> >  arch/mips/cavium-octeon/executive/cvmx-sysinfo.c   | 2 +-
> >  arch/mips/cavium-octeon/smp.c  | 3 ++-
> >  arch/mips/dec/prom/identify.c  | 2 +-
> >  arch/mips/dec/setup.c  | 2 +-
> >  arch/mips/dec/wbflush.c| 4 +---
> >  arch/mips/jazz/jazzdma.c  

Re: [PATCH] mips: audit and remove any unnecessary uses of module.h

2017-02-14 Thread Paul Gortmaker
[Re: [PATCH] mips: audit and remove any unnecessary uses of module.h] On 
14/02/2017 (Tue 10:10) James Hogan wrote:

> On Sat, Jan 28, 2017 at 09:05:57PM -0500, Paul Gortmaker wrote:
> > Historically a lot of these existed because we did not have
> > a distinction between what was modular code and what was providing
> > support to modules via EXPORT_SYMBOL and friends.  That changed
> > when we forked out support for the latter into the export.h file.
> > 
> > This means we should be able to reduce the usage of module.h
> > in code that is obj-y Makefile or bool Kconfig.  In the case of
> > some code where it is modular, we can extend that to also include
> > files that are building basic support functionality but not related
> > to loading or registering the final module; such files also have
> > no need whatsoever for module.h
> > 
> > The advantage in removing such instances is that module.h itself
> > sources about 15 other headers; adding significantly to what we feed
> > cpp, and it can obscure what headers we are effectively using.
> > 
> > Since module.h might have been the implicit source for init.h
> > (for __init) and for export.h (for EXPORT_SYMBOL) we consider each
> > instance for the presence of either and replace/add as needed.
> > 
> > Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> > 
> > Build coverage of all the mips defconfigs revealed the module.h
> > header was masking a couple of implicit include instances, so
> > we add the appropriate headers there.
> > 
> > Cc: David Daney 
> > Cc: John Crispin 
> > Cc: Ralf Baechle 
> > Cc: "Steven J. Hill" 
> > Cc: linux-m...@linux-mips.org
> > Signed-off-by: Paul Gortmaker 
> 
> Applied (with a couple of tweaks to preserve existing sort order)

Thanks -- were you hoping for xmas tree order (string length) or
alphabetical sort?  I'll make a mental note to check that for any future
MIPS patches I have.

P.
--

> 
> Thanks
> James
> 
> > ---
> > 
> > [I had this split along platform lines into 17 separate commits, but
> >  when I realized there were only 3 platform specific maintainers called
> >  out, I thought that was probably overkill.  If the split version is
> >  desired, let me know.
> > 
> >  Also, this is against v4.10-rc5.  The same patch against linux-next
> >  will have a trivial conflict in xway dma.c due to a spinlock.h
> >  addition there. ]
> > 
> >  arch/mips/alchemy/common/dbdma.c   | 2 +-
> >  arch/mips/alchemy/common/dma.c | 2 +-
> >  arch/mips/alchemy/common/gpiolib.c | 1 -
> >  arch/mips/alchemy/common/prom.c| 1 -
> >  arch/mips/alchemy/common/usb.c | 2 +-
> >  arch/mips/alchemy/common/vss.c | 2 +-
> >  arch/mips/alchemy/devboards/bcsr.c | 3 ++-
> >  arch/mips/ar7/clock.c  | 2 +-
> >  arch/mips/ar7/gpio.c   | 3 ++-
> >  arch/mips/ar7/memory.c | 1 -
> >  arch/mips/ar7/platform.c   | 1 -
> >  arch/mips/ar7/prom.c   | 2 +-
> >  arch/mips/ath79/clock.c| 1 -
> >  arch/mips/ath79/common.c   | 2 +-
> >  arch/mips/bcm63xx/clk.c| 3 ++-
> >  arch/mips/bcm63xx/cpu.c| 2 +-
> >  arch/mips/bcm63xx/cs.c | 3 ++-
> >  arch/mips/bcm63xx/gpio.c   | 2 +-
> >  arch/mips/bcm63xx/irq.c| 1 -
> >  arch/mips/bcm63xx/reset.c  | 3 ++-
> >  arch/mips/bcm63xx/timer.c  | 3 ++-
> >  arch/mips/cavium-octeon/crypto/octeon-crypto.c | 2 +-
> >  arch/mips/cavium-octeon/executive/cvmx-bootmem.c   | 2 +-
> >  arch/mips/cavium-octeon/executive/cvmx-helper-errata.c | 2 +-
> >  arch/mips/cavium-octeon/executive/cvmx-sysinfo.c   | 2 +-
> >  arch/mips/cavium-octeon/smp.c  | 3 ++-
> >  arch/mips/dec/prom/identify.c  | 2 +-
> >  arch/mips/dec/setup.c  | 2 +-
> >  arch/mips/dec/wbflush.c| 4 +---
> >  arch/mips/jazz/jazzdma.c   | 2 +-
> >  arch/mips/jz4740/gpio.c| 2 +-
> >  arch/mips/jz4740/prom.c   

Re: [PATCH] mips: audit and remove any unnecessary uses of module.h

2017-02-14 Thread James Hogan
On Sat, Jan 28, 2017 at 09:05:57PM -0500, Paul Gortmaker wrote:
> Historically a lot of these existed because we did not have
> a distinction between what was modular code and what was providing
> support to modules via EXPORT_SYMBOL and friends.  That changed
> when we forked out support for the latter into the export.h file.
> 
> This means we should be able to reduce the usage of module.h
> in code that is obj-y Makefile or bool Kconfig.  In the case of
> some code where it is modular, we can extend that to also include
> files that are building basic support functionality but not related
> to loading or registering the final module; such files also have
> no need whatsoever for module.h
> 
> The advantage in removing such instances is that module.h itself
> sources about 15 other headers; adding significantly to what we feed
> cpp, and it can obscure what headers we are effectively using.
> 
> Since module.h might have been the implicit source for init.h
> (for __init) and for export.h (for EXPORT_SYMBOL) we consider each
> instance for the presence of either and replace/add as needed.
> 
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> 
> Build coverage of all the mips defconfigs revealed the module.h
> header was masking a couple of implicit include instances, so
> we add the appropriate headers there.
> 
> Cc: David Daney 
> Cc: John Crispin 
> Cc: Ralf Baechle 
> Cc: "Steven J. Hill" 
> Cc: linux-m...@linux-mips.org
> Signed-off-by: Paul Gortmaker 

Applied (with a couple of tweaks to preserve existing sort order)

Thanks
James

> ---
> 
> [I had this split along platform lines into 17 separate commits, but
>  when I realized there were only 3 platform specific maintainers called
>  out, I thought that was probably overkill.  If the split version is
>  desired, let me know.
> 
>  Also, this is against v4.10-rc5.  The same patch against linux-next
>  will have a trivial conflict in xway dma.c due to a spinlock.h
>  addition there. ]
> 
>  arch/mips/alchemy/common/dbdma.c   | 2 +-
>  arch/mips/alchemy/common/dma.c | 2 +-
>  arch/mips/alchemy/common/gpiolib.c | 1 -
>  arch/mips/alchemy/common/prom.c| 1 -
>  arch/mips/alchemy/common/usb.c | 2 +-
>  arch/mips/alchemy/common/vss.c | 2 +-
>  arch/mips/alchemy/devboards/bcsr.c | 3 ++-
>  arch/mips/ar7/clock.c  | 2 +-
>  arch/mips/ar7/gpio.c   | 3 ++-
>  arch/mips/ar7/memory.c | 1 -
>  arch/mips/ar7/platform.c   | 1 -
>  arch/mips/ar7/prom.c   | 2 +-
>  arch/mips/ath79/clock.c| 1 -
>  arch/mips/ath79/common.c   | 2 +-
>  arch/mips/bcm63xx/clk.c| 3 ++-
>  arch/mips/bcm63xx/cpu.c| 2 +-
>  arch/mips/bcm63xx/cs.c | 3 ++-
>  arch/mips/bcm63xx/gpio.c   | 2 +-
>  arch/mips/bcm63xx/irq.c| 1 -
>  arch/mips/bcm63xx/reset.c  | 3 ++-
>  arch/mips/bcm63xx/timer.c  | 3 ++-
>  arch/mips/cavium-octeon/crypto/octeon-crypto.c | 2 +-
>  arch/mips/cavium-octeon/executive/cvmx-bootmem.c   | 2 +-
>  arch/mips/cavium-octeon/executive/cvmx-helper-errata.c | 2 +-
>  arch/mips/cavium-octeon/executive/cvmx-sysinfo.c   | 2 +-
>  arch/mips/cavium-octeon/smp.c  | 3 ++-
>  arch/mips/dec/prom/identify.c  | 2 +-
>  arch/mips/dec/setup.c  | 2 +-
>  arch/mips/dec/wbflush.c| 4 +---
>  arch/mips/jazz/jazzdma.c   | 2 +-
>  arch/mips/jz4740/gpio.c| 2 +-
>  arch/mips/jz4740/prom.c| 1 -
>  arch/mips/jz4740/timer.c   | 3 ++-
>  arch/mips/lantiq/xway/dma.c| 3 +--
>  arch/mips/lantiq/xway/gptu.c   | 3 +--
>  arch/mips/lasat/at93c.c| 1 -
>  arch/mips/lasat/sysctl.c   | 1 -
>  arch/mips/loongson64/common/cs5536/cs5536_mfgpt.c  | 2 +-
>  arch/mips/loongson64/common/env.c  | 2 +-
>  arch/mips/loongson64/common/setup.c| 3 ++-
>  arch/mips/loongson64/common/uart_base.c| 2 +-
>  arch/mips/loongson64/lemote-2f/ec_kb3310b.c| 3 ++-
>  arch/mips/loongson64/lemote-2f/irq.c   | 3 ++-
>  arch/mips/loongson64/lemote-2f/pm.c| 2 +-
>  

Re: [PATCH] mips: audit and remove any unnecessary uses of module.h

2017-02-14 Thread James Hogan
On Sat, Jan 28, 2017 at 09:05:57PM -0500, Paul Gortmaker wrote:
> Historically a lot of these existed because we did not have
> a distinction between what was modular code and what was providing
> support to modules via EXPORT_SYMBOL and friends.  That changed
> when we forked out support for the latter into the export.h file.
> 
> This means we should be able to reduce the usage of module.h
> in code that is obj-y Makefile or bool Kconfig.  In the case of
> some code where it is modular, we can extend that to also include
> files that are building basic support functionality but not related
> to loading or registering the final module; such files also have
> no need whatsoever for module.h
> 
> The advantage in removing such instances is that module.h itself
> sources about 15 other headers; adding significantly to what we feed
> cpp, and it can obscure what headers we are effectively using.
> 
> Since module.h might have been the implicit source for init.h
> (for __init) and for export.h (for EXPORT_SYMBOL) we consider each
> instance for the presence of either and replace/add as needed.
> 
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> 
> Build coverage of all the mips defconfigs revealed the module.h
> header was masking a couple of implicit include instances, so
> we add the appropriate headers there.
> 
> Cc: David Daney 
> Cc: John Crispin 
> Cc: Ralf Baechle 
> Cc: "Steven J. Hill" 
> Cc: linux-m...@linux-mips.org
> Signed-off-by: Paul Gortmaker 

Applied (with a couple of tweaks to preserve existing sort order)

Thanks
James

> ---
> 
> [I had this split along platform lines into 17 separate commits, but
>  when I realized there were only 3 platform specific maintainers called
>  out, I thought that was probably overkill.  If the split version is
>  desired, let me know.
> 
>  Also, this is against v4.10-rc5.  The same patch against linux-next
>  will have a trivial conflict in xway dma.c due to a spinlock.h
>  addition there. ]
> 
>  arch/mips/alchemy/common/dbdma.c   | 2 +-
>  arch/mips/alchemy/common/dma.c | 2 +-
>  arch/mips/alchemy/common/gpiolib.c | 1 -
>  arch/mips/alchemy/common/prom.c| 1 -
>  arch/mips/alchemy/common/usb.c | 2 +-
>  arch/mips/alchemy/common/vss.c | 2 +-
>  arch/mips/alchemy/devboards/bcsr.c | 3 ++-
>  arch/mips/ar7/clock.c  | 2 +-
>  arch/mips/ar7/gpio.c   | 3 ++-
>  arch/mips/ar7/memory.c | 1 -
>  arch/mips/ar7/platform.c   | 1 -
>  arch/mips/ar7/prom.c   | 2 +-
>  arch/mips/ath79/clock.c| 1 -
>  arch/mips/ath79/common.c   | 2 +-
>  arch/mips/bcm63xx/clk.c| 3 ++-
>  arch/mips/bcm63xx/cpu.c| 2 +-
>  arch/mips/bcm63xx/cs.c | 3 ++-
>  arch/mips/bcm63xx/gpio.c   | 2 +-
>  arch/mips/bcm63xx/irq.c| 1 -
>  arch/mips/bcm63xx/reset.c  | 3 ++-
>  arch/mips/bcm63xx/timer.c  | 3 ++-
>  arch/mips/cavium-octeon/crypto/octeon-crypto.c | 2 +-
>  arch/mips/cavium-octeon/executive/cvmx-bootmem.c   | 2 +-
>  arch/mips/cavium-octeon/executive/cvmx-helper-errata.c | 2 +-
>  arch/mips/cavium-octeon/executive/cvmx-sysinfo.c   | 2 +-
>  arch/mips/cavium-octeon/smp.c  | 3 ++-
>  arch/mips/dec/prom/identify.c  | 2 +-
>  arch/mips/dec/setup.c  | 2 +-
>  arch/mips/dec/wbflush.c| 4 +---
>  arch/mips/jazz/jazzdma.c   | 2 +-
>  arch/mips/jz4740/gpio.c| 2 +-
>  arch/mips/jz4740/prom.c| 1 -
>  arch/mips/jz4740/timer.c   | 3 ++-
>  arch/mips/lantiq/xway/dma.c| 3 +--
>  arch/mips/lantiq/xway/gptu.c   | 3 +--
>  arch/mips/lasat/at93c.c| 1 -
>  arch/mips/lasat/sysctl.c   | 1 -
>  arch/mips/loongson64/common/cs5536/cs5536_mfgpt.c  | 2 +-
>  arch/mips/loongson64/common/env.c  | 2 +-
>  arch/mips/loongson64/common/setup.c| 3 ++-
>  arch/mips/loongson64/common/uart_base.c| 2 +-
>  arch/mips/loongson64/lemote-2f/ec_kb3310b.c| 3 ++-
>  arch/mips/loongson64/lemote-2f/irq.c   | 3 ++-
>  arch/mips/loongson64/lemote-2f/pm.c| 2 +-
>  arch/mips/loongson64/loongson-3/irq.c  | 2 +-
>  arch/mips/loongson64/loongson-3/numa.c | 2 +-
>  

[PATCH] mips: audit and remove any unnecessary uses of module.h

2017-01-28 Thread Paul Gortmaker
Historically a lot of these existed because we did not have
a distinction between what was modular code and what was providing
support to modules via EXPORT_SYMBOL and friends.  That changed
when we forked out support for the latter into the export.h file.

This means we should be able to reduce the usage of module.h
in code that is obj-y Makefile or bool Kconfig.  In the case of
some code where it is modular, we can extend that to also include
files that are building basic support functionality but not related
to loading or registering the final module; such files also have
no need whatsoever for module.h

The advantage in removing such instances is that module.h itself
sources about 15 other headers; adding significantly to what we feed
cpp, and it can obscure what headers we are effectively using.

Since module.h might have been the implicit source for init.h
(for __init) and for export.h (for EXPORT_SYMBOL) we consider each
instance for the presence of either and replace/add as needed.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

Build coverage of all the mips defconfigs revealed the module.h
header was masking a couple of implicit include instances, so
we add the appropriate headers there.

Cc: David Daney 
Cc: John Crispin 
Cc: Ralf Baechle 
Cc: "Steven J. Hill" 
Cc: linux-m...@linux-mips.org
Signed-off-by: Paul Gortmaker 
---

[I had this split along platform lines into 17 separate commits, but
 when I realized there were only 3 platform specific maintainers called
 out, I thought that was probably overkill.  If the split version is
 desired, let me know.

 Also, this is against v4.10-rc5.  The same patch against linux-next
 will have a trivial conflict in xway dma.c due to a spinlock.h
 addition there. ]

 arch/mips/alchemy/common/dbdma.c   | 2 +-
 arch/mips/alchemy/common/dma.c | 2 +-
 arch/mips/alchemy/common/gpiolib.c | 1 -
 arch/mips/alchemy/common/prom.c| 1 -
 arch/mips/alchemy/common/usb.c | 2 +-
 arch/mips/alchemy/common/vss.c | 2 +-
 arch/mips/alchemy/devboards/bcsr.c | 3 ++-
 arch/mips/ar7/clock.c  | 2 +-
 arch/mips/ar7/gpio.c   | 3 ++-
 arch/mips/ar7/memory.c | 1 -
 arch/mips/ar7/platform.c   | 1 -
 arch/mips/ar7/prom.c   | 2 +-
 arch/mips/ath79/clock.c| 1 -
 arch/mips/ath79/common.c   | 2 +-
 arch/mips/bcm63xx/clk.c| 3 ++-
 arch/mips/bcm63xx/cpu.c| 2 +-
 arch/mips/bcm63xx/cs.c | 3 ++-
 arch/mips/bcm63xx/gpio.c   | 2 +-
 arch/mips/bcm63xx/irq.c| 1 -
 arch/mips/bcm63xx/reset.c  | 3 ++-
 arch/mips/bcm63xx/timer.c  | 3 ++-
 arch/mips/cavium-octeon/crypto/octeon-crypto.c | 2 +-
 arch/mips/cavium-octeon/executive/cvmx-bootmem.c   | 2 +-
 arch/mips/cavium-octeon/executive/cvmx-helper-errata.c | 2 +-
 arch/mips/cavium-octeon/executive/cvmx-sysinfo.c   | 2 +-
 arch/mips/cavium-octeon/smp.c  | 3 ++-
 arch/mips/dec/prom/identify.c  | 2 +-
 arch/mips/dec/setup.c  | 2 +-
 arch/mips/dec/wbflush.c| 4 +---
 arch/mips/jazz/jazzdma.c   | 2 +-
 arch/mips/jz4740/gpio.c| 2 +-
 arch/mips/jz4740/prom.c| 1 -
 arch/mips/jz4740/timer.c   | 3 ++-
 arch/mips/lantiq/xway/dma.c| 3 +--
 arch/mips/lantiq/xway/gptu.c   | 3 +--
 arch/mips/lasat/at93c.c| 1 -
 arch/mips/lasat/sysctl.c   | 1 -
 arch/mips/loongson64/common/cs5536/cs5536_mfgpt.c  | 2 +-
 arch/mips/loongson64/common/env.c  | 2 +-
 arch/mips/loongson64/common/setup.c| 3 ++-
 arch/mips/loongson64/common/uart_base.c| 2 +-
 arch/mips/loongson64/lemote-2f/ec_kb3310b.c| 3 ++-
 arch/mips/loongson64/lemote-2f/irq.c   | 3 ++-
 arch/mips/loongson64/lemote-2f/pm.c| 2 +-
 arch/mips/loongson64/loongson-3/irq.c  | 2 +-
 arch/mips/loongson64/loongson-3/numa.c | 2 +-
 arch/mips/mti-malta/malta-platform.c   | 1 -
 arch/mips/pmcs-msp71xx/msp_prom.c  | 2 +-
 arch/mips/pmcs-msp71xx/msp_time.c  | 1 -
 

[PATCH] mips: audit and remove any unnecessary uses of module.h

2017-01-28 Thread Paul Gortmaker
Historically a lot of these existed because we did not have
a distinction between what was modular code and what was providing
support to modules via EXPORT_SYMBOL and friends.  That changed
when we forked out support for the latter into the export.h file.

This means we should be able to reduce the usage of module.h
in code that is obj-y Makefile or bool Kconfig.  In the case of
some code where it is modular, we can extend that to also include
files that are building basic support functionality but not related
to loading or registering the final module; such files also have
no need whatsoever for module.h

The advantage in removing such instances is that module.h itself
sources about 15 other headers; adding significantly to what we feed
cpp, and it can obscure what headers we are effectively using.

Since module.h might have been the implicit source for init.h
(for __init) and for export.h (for EXPORT_SYMBOL) we consider each
instance for the presence of either and replace/add as needed.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

Build coverage of all the mips defconfigs revealed the module.h
header was masking a couple of implicit include instances, so
we add the appropriate headers there.

Cc: David Daney 
Cc: John Crispin 
Cc: Ralf Baechle 
Cc: "Steven J. Hill" 
Cc: linux-m...@linux-mips.org
Signed-off-by: Paul Gortmaker 
---

[I had this split along platform lines into 17 separate commits, but
 when I realized there were only 3 platform specific maintainers called
 out, I thought that was probably overkill.  If the split version is
 desired, let me know.

 Also, this is against v4.10-rc5.  The same patch against linux-next
 will have a trivial conflict in xway dma.c due to a spinlock.h
 addition there. ]

 arch/mips/alchemy/common/dbdma.c   | 2 +-
 arch/mips/alchemy/common/dma.c | 2 +-
 arch/mips/alchemy/common/gpiolib.c | 1 -
 arch/mips/alchemy/common/prom.c| 1 -
 arch/mips/alchemy/common/usb.c | 2 +-
 arch/mips/alchemy/common/vss.c | 2 +-
 arch/mips/alchemy/devboards/bcsr.c | 3 ++-
 arch/mips/ar7/clock.c  | 2 +-
 arch/mips/ar7/gpio.c   | 3 ++-
 arch/mips/ar7/memory.c | 1 -
 arch/mips/ar7/platform.c   | 1 -
 arch/mips/ar7/prom.c   | 2 +-
 arch/mips/ath79/clock.c| 1 -
 arch/mips/ath79/common.c   | 2 +-
 arch/mips/bcm63xx/clk.c| 3 ++-
 arch/mips/bcm63xx/cpu.c| 2 +-
 arch/mips/bcm63xx/cs.c | 3 ++-
 arch/mips/bcm63xx/gpio.c   | 2 +-
 arch/mips/bcm63xx/irq.c| 1 -
 arch/mips/bcm63xx/reset.c  | 3 ++-
 arch/mips/bcm63xx/timer.c  | 3 ++-
 arch/mips/cavium-octeon/crypto/octeon-crypto.c | 2 +-
 arch/mips/cavium-octeon/executive/cvmx-bootmem.c   | 2 +-
 arch/mips/cavium-octeon/executive/cvmx-helper-errata.c | 2 +-
 arch/mips/cavium-octeon/executive/cvmx-sysinfo.c   | 2 +-
 arch/mips/cavium-octeon/smp.c  | 3 ++-
 arch/mips/dec/prom/identify.c  | 2 +-
 arch/mips/dec/setup.c  | 2 +-
 arch/mips/dec/wbflush.c| 4 +---
 arch/mips/jazz/jazzdma.c   | 2 +-
 arch/mips/jz4740/gpio.c| 2 +-
 arch/mips/jz4740/prom.c| 1 -
 arch/mips/jz4740/timer.c   | 3 ++-
 arch/mips/lantiq/xway/dma.c| 3 +--
 arch/mips/lantiq/xway/gptu.c   | 3 +--
 arch/mips/lasat/at93c.c| 1 -
 arch/mips/lasat/sysctl.c   | 1 -
 arch/mips/loongson64/common/cs5536/cs5536_mfgpt.c  | 2 +-
 arch/mips/loongson64/common/env.c  | 2 +-
 arch/mips/loongson64/common/setup.c| 3 ++-
 arch/mips/loongson64/common/uart_base.c| 2 +-
 arch/mips/loongson64/lemote-2f/ec_kb3310b.c| 3 ++-
 arch/mips/loongson64/lemote-2f/irq.c   | 3 ++-
 arch/mips/loongson64/lemote-2f/pm.c| 2 +-
 arch/mips/loongson64/loongson-3/irq.c  | 2 +-
 arch/mips/loongson64/loongson-3/numa.c | 2 +-
 arch/mips/mti-malta/malta-platform.c   | 1 -
 arch/mips/pmcs-msp71xx/msp_prom.c  | 2 +-
 arch/mips/pmcs-msp71xx/msp_time.c  | 1 -
 arch/mips/ralink/clk.c | 3 ++-
 arch/mips/ralink/mt7620.c  | 1 -