* [PATCH] asm-generic/io.h: remove unnecessary #include of <linux/vmalloc.h>
@ 2017-05-09 8:50 Tobias Klauser
2017-05-09 9:02 ` Michal Hocko
2017-05-09 12:01 ` kbuild test robot
0 siblings, 2 replies; 5+ messages in thread
From: Tobias Klauser @ 2017-05-09 8:50 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Andrew Morton, linux-arch, linux-kernel, Michal Hocko, Ley Foon Tan
After commit 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
the build for ARCH=nios2 fails with:
In file included from ./include/asm-generic/io.h:767:0,
from ./arch/nios2/include/asm/io.h:61,
from ./include/linux/io.h:25,
from ./arch/nios2/include/asm/pgtable.h:18,
from ./include/linux/mm.h:70,
from ./include/linux/pid_namespace.h:6,
from ./include/linux/ptrace.h:9,
from ./arch/nios2/include/uapi/asm/elf.h:23,
from ./arch/nios2/include/asm/elf.h:22,
from ./include/linux/elf.h:4,
from ./include/linux/module.h:15,
from init/main.c:16:
./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?
which is due to the newly added #include <asm/pgtable.h>, which on nios2
includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
again includes <linux/vmalloc.h>.
It turns out the #include <linux/vmalloc.h> in <asm-generic/io.h> isn't
necessary at all since none of it definitions are used there, so remove
it alltogether.
Build tested on
- nios2: 10m50_defconfig
- x86: allyesconfig, various randconfigs
- arm: tegra_defconfig, various randconfigs
Cc: Michal Hocko <mhocko@suse.com>
Cc: Ley Foon Tan <lftan@altera.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
include/asm-generic/io.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 7ef015eb3403..fe5e01fbed54 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -764,7 +764,6 @@ static inline void iowrite64_rep(volatile void __iomem *addr,
#ifdef __KERNEL__
-#include <linux/vmalloc.h>
#define __io_virt(x) ((void __force *)(x))
#ifndef CONFIG_GENERIC_IOMAP
--
2.12.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] asm-generic/io.h: remove unnecessary #include of <linux/vmalloc.h>
2017-05-09 8:50 [PATCH] asm-generic/io.h: remove unnecessary #include of <linux/vmalloc.h> Tobias Klauser
@ 2017-05-09 9:02 ` Michal Hocko
2017-05-09 13:16 ` Tobias Klauser
2017-05-09 12:01 ` kbuild test robot
1 sibling, 1 reply; 5+ messages in thread
From: Michal Hocko @ 2017-05-09 9:02 UTC (permalink / raw)
To: Tobias Klauser
Cc: Arnd Bergmann, Andrew Morton, linux-arch, linux-kernel, Ley Foon Tan
On Tue 09-05-17 10:50:45, Tobias Klauser wrote:
> After commit 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
> the build for ARCH=nios2 fails with:
>
> In file included from ./include/asm-generic/io.h:767:0,
> from ./arch/nios2/include/asm/io.h:61,
> from ./include/linux/io.h:25,
> from ./arch/nios2/include/asm/pgtable.h:18,
> from ./include/linux/mm.h:70,
> from ./include/linux/pid_namespace.h:6,
> from ./include/linux/ptrace.h:9,
> from ./arch/nios2/include/uapi/asm/elf.h:23,
> from ./arch/nios2/include/asm/elf.h:22,
> from ./include/linux/elf.h:4,
> from ./include/linux/module.h:15,
> from init/main.c:16:
> ./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
> ./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?
>
> which is due to the newly added #include <asm/pgtable.h>, which on nios2
> includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
> again includes <linux/vmalloc.h>.
>
> It turns out the #include <linux/vmalloc.h> in <asm-generic/io.h> isn't
> necessary at all since none of it definitions are used there, so remove
> it alltogether.
Thanks for your fix but I have already posted a different one [1] which
doesn't include pgtable.h because this turned out to be a problem on
m68k already. I am just waiting for Andrew to drop the previous patch
and replace it with the one pointed out.
[1] http://lkml.kernel.org/r/20170503063750.GC1236@dhcp22.suse.cz
>
> Build tested on
> - nios2: 10m50_defconfig
> - x86: allyesconfig, various randconfigs
> - arm: tegra_defconfig, various randconfigs
>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Ley Foon Tan <lftan@altera.com>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> ---
> include/asm-generic/io.h | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
> index 7ef015eb3403..fe5e01fbed54 100644
> --- a/include/asm-generic/io.h
> +++ b/include/asm-generic/io.h
> @@ -764,7 +764,6 @@ static inline void iowrite64_rep(volatile void __iomem *addr,
>
> #ifdef __KERNEL__
>
> -#include <linux/vmalloc.h>
> #define __io_virt(x) ((void __force *)(x))
>
> #ifndef CONFIG_GENERIC_IOMAP
> --
> 2.12.2
>
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] asm-generic/io.h: remove unnecessary #include of <linux/vmalloc.h>
2017-05-09 8:50 [PATCH] asm-generic/io.h: remove unnecessary #include of <linux/vmalloc.h> Tobias Klauser
2017-05-09 9:02 ` Michal Hocko
@ 2017-05-09 12:01 ` kbuild test robot
1 sibling, 0 replies; 5+ messages in thread
From: kbuild test robot @ 2017-05-09 12:01 UTC (permalink / raw)
To: Tobias Klauser
Cc: kbuild-all, Arnd Bergmann, Andrew Morton, linux-arch,
linux-kernel, Michal Hocko, Ley Foon Tan
[-- Attachment #1: Type: text/plain, Size: 4174 bytes --]
Hi Tobias,
[auto build test ERROR on v4.9-rc8]
[also build test ERROR on next-20170509]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Tobias-Klauser/asm-generic-io-h-remove-unnecessary-include-of-linux-vmalloc-h/20170509-184856
config: arm-sunxi_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm
All errors (new ones prefixed by >>):
drivers/clk/sunxi-ng/ccu_reset.h:28:41: sparse: expected ; at end of declaration
drivers/clk/sunxi-ng/ccu_reset.h:28:41: sparse: Expected } at end of struct-union-enum-specifier
drivers/clk/sunxi-ng/ccu_reset.h:28:41: sparse: got *
drivers/clk/sunxi-ng/ccu_reset.h:31:1: sparse: Expected ; at the end of type declaration
drivers/clk/sunxi-ng/ccu_reset.h:31:1: sparse: got }
drivers/clk/sunxi-ng/ccu_reset.h:35:16: sparse: no member 'rcdev' in struct ccu_reset
drivers/clk/sunxi-ng/ccu_reset.h:35:16: sparse: unknown member
drivers/clk/sunxi-ng/ccu_reset.h:35:16: sparse: cast from unknown type
drivers/clk/sunxi-ng/ccu_reset.c:24:9: sparse: undefined identifier 'spin_lock_irqsave'
drivers/clk/sunxi-ng/ccu_reset.c:29:9: sparse: undefined identifier 'spin_unlock_irqrestore'
drivers/clk/sunxi-ng/ccu_reset.h:35:16: sparse: incompatible types for operation (-)
drivers/clk/sunxi-ng/ccu_reset.h:35:16: left side has type char *<noident>
drivers/clk/sunxi-ng/ccu_reset.h:35:16: right side has type bad type
drivers/clk/sunxi-ng/ccu_reset.c:42:9: sparse: undefined identifier 'spin_lock_irqsave'
drivers/clk/sunxi-ng/ccu_reset.c:47:9: sparse: undefined identifier 'spin_unlock_irqrestore'
In file included from drivers/clk/sunxi-ng/ccu_reset.c:14:0:
>> drivers/clk/sunxi-ng/ccu_reset.h:28:2: error: unknown type name 'spinlock_t'
spinlock_t *lock;
^~~~~~~~~~
drivers/clk/sunxi-ng/ccu_reset.c: In function 'ccu_reset_assert':
>> drivers/clk/sunxi-ng/ccu_reset.c:24:2: error: implicit declaration of function 'spin_lock_irqsave' [-Werror=implicit-function-declaration]
spin_lock_irqsave(ccu->lock, flags);
^~~~~~~~~~~~~~~~~
>> drivers/clk/sunxi-ng/ccu_reset.c:29:2: error: implicit declaration of function 'spin_unlock_irqrestore' [-Werror=implicit-function-declaration]
spin_unlock_irqrestore(ccu->lock, flags);
^~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/spinlock_t +28 drivers/clk/sunxi-ng/ccu_reset.h
1d80c142 Maxime Ripard 2016-06-29 22 };
1d80c142 Maxime Ripard 2016-06-29 23
1d80c142 Maxime Ripard 2016-06-29 24
1d80c142 Maxime Ripard 2016-06-29 25 struct ccu_reset {
1d80c142 Maxime Ripard 2016-06-29 26 void __iomem *base;
1d80c142 Maxime Ripard 2016-06-29 27 struct ccu_reset_map *reset_map;
1d80c142 Maxime Ripard 2016-06-29 @28 spinlock_t *lock;
1d80c142 Maxime Ripard 2016-06-29 29
1d80c142 Maxime Ripard 2016-06-29 30 struct reset_controller_dev rcdev;
1d80c142 Maxime Ripard 2016-06-29 31 };
1d80c142 Maxime Ripard 2016-06-29 32
1d80c142 Maxime Ripard 2016-06-29 33 static inline struct ccu_reset *rcdev_to_ccu_reset(struct reset_controller_dev *rcdev)
1d80c142 Maxime Ripard 2016-06-29 34 {
1d80c142 Maxime Ripard 2016-06-29 @35 return container_of(rcdev, struct ccu_reset, rcdev);
1d80c142 Maxime Ripard 2016-06-29 36 }
1d80c142 Maxime Ripard 2016-06-29 37
1d80c142 Maxime Ripard 2016-06-29 38 extern const struct reset_control_ops ccu_reset_ops;
:::::: The code at line 28 was first introduced by commit
:::::: 1d80c14248d6082c91a8a9e3d70cc94c3cc18ecb clk: sunxi-ng: Add common infrastructure
:::::: TO: Maxime Ripard <maxime.ripard@free-electrons.com>
:::::: CC: Michael Turquette <mturquette@baylibre.com>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 20276 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] asm-generic/io.h: remove unnecessary #include of <linux/vmalloc.h>
2017-05-09 9:02 ` Michal Hocko
@ 2017-05-09 13:16 ` Tobias Klauser
2017-05-09 13:40 ` Michal Hocko
0 siblings, 1 reply; 5+ messages in thread
From: Tobias Klauser @ 2017-05-09 13:16 UTC (permalink / raw)
To: Michal Hocko
Cc: Arnd Bergmann, Andrew Morton, linux-arch, linux-kernel, Ley Foon Tan
On 2017-05-09 at 11:02:07 +0200, Michal Hocko <mhocko@kernel.org> wrote:
> On Tue 09-05-17 10:50:45, Tobias Klauser wrote:
> > After commit 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
> > the build for ARCH=nios2 fails with:
> >
> > In file included from ./include/asm-generic/io.h:767:0,
> > from ./arch/nios2/include/asm/io.h:61,
> > from ./include/linux/io.h:25,
> > from ./arch/nios2/include/asm/pgtable.h:18,
> > from ./include/linux/mm.h:70,
> > from ./include/linux/pid_namespace.h:6,
> > from ./include/linux/ptrace.h:9,
> > from ./arch/nios2/include/uapi/asm/elf.h:23,
> > from ./arch/nios2/include/asm/elf.h:22,
> > from ./include/linux/elf.h:4,
> > from ./include/linux/module.h:15,
> > from init/main.c:16:
> > ./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
> > ./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?
> >
> > which is due to the newly added #include <asm/pgtable.h>, which on nios2
> > includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
> > again includes <linux/vmalloc.h>.
> >
> > It turns out the #include <linux/vmalloc.h> in <asm-generic/io.h> isn't
> > necessary at all since none of it definitions are used there, so remove
> > it alltogether.
>
> Thanks for your fix but I have already posted a different one [1] which
> doesn't include pgtable.h because this turned out to be a problem on
> m68k already. I am just waiting for Andrew to drop the previous patch
> and replace it with the one pointed out.
>
> [1] http://lkml.kernel.org/r/20170503063750.GC1236@dhcp22.suse.cz
Thanks for the info. Though it looks like your original patch already
made it into Linus' tree as commit 1f5307b1e094.
As for my patch, please disregard - it lead to several build regressions
with the kernel build bot.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] asm-generic/io.h: remove unnecessary #include of <linux/vmalloc.h>
2017-05-09 13:16 ` Tobias Klauser
@ 2017-05-09 13:40 ` Michal Hocko
0 siblings, 0 replies; 5+ messages in thread
From: Michal Hocko @ 2017-05-09 13:40 UTC (permalink / raw)
To: Tobias Klauser
Cc: Arnd Bergmann, Andrew Morton, linux-arch, linux-kernel, Ley Foon Tan
On Tue 09-05-17 15:16:20, Tobias Klauser wrote:
> On 2017-05-09 at 11:02:07 +0200, Michal Hocko <mhocko@kernel.org> wrote:
> > On Tue 09-05-17 10:50:45, Tobias Klauser wrote:
> > > After commit 1f5307b1e094 ("mm, vmalloc: properly track vmalloc users")
> > > the build for ARCH=nios2 fails with:
> > >
> > > In file included from ./include/asm-generic/io.h:767:0,
> > > from ./arch/nios2/include/asm/io.h:61,
> > > from ./include/linux/io.h:25,
> > > from ./arch/nios2/include/asm/pgtable.h:18,
> > > from ./include/linux/mm.h:70,
> > > from ./include/linux/pid_namespace.h:6,
> > > from ./include/linux/ptrace.h:9,
> > > from ./arch/nios2/include/uapi/asm/elf.h:23,
> > > from ./arch/nios2/include/asm/elf.h:22,
> > > from ./include/linux/elf.h:4,
> > > from ./include/linux/module.h:15,
> > > from init/main.c:16:
> > > ./include/linux/vmalloc.h: In function '__vmalloc_node_flags':
> > > ./include/linux/vmalloc.h:99:40: error: 'PAGE_KERNEL' undeclared (first use in this function); did you mean 'GFP_KERNEL'?
> > >
> > > which is due to the newly added #include <asm/pgtable.h>, which on nios2
> > > includes <linux/io.h> and thus <asm/io.h> and <asm-generic/io.h> which
> > > again includes <linux/vmalloc.h>.
> > >
> > > It turns out the #include <linux/vmalloc.h> in <asm-generic/io.h> isn't
> > > necessary at all since none of it definitions are used there, so remove
> > > it alltogether.
> >
> > Thanks for your fix but I have already posted a different one [1] which
> > doesn't include pgtable.h because this turned out to be a problem on
> > m68k already. I am just waiting for Andrew to drop the previous patch
> > and replace it with the one pointed out.
> >
> > [1] http://lkml.kernel.org/r/20170503063750.GC1236@dhcp22.suse.cz
>
> Thanks for the info. Though it looks like your original patch already
> made it into Linus' tree as commit 1f5307b1e094.
Ups! I though Andrew would leave it for later as it had compilation
issues.
> As for my patch, please disregard - it lead to several build regressions
> with the kernel build bot.
Yeah, I've learned that as well, so I've rather came with a different
solution. I will poke Andrew to marge a fix ASAP.
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-05-09 13:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-09 8:50 [PATCH] asm-generic/io.h: remove unnecessary #include of <linux/vmalloc.h> Tobias Klauser
2017-05-09 9:02 ` Michal Hocko
2017-05-09 13:16 ` Tobias Klauser
2017-05-09 13:40 ` Michal Hocko
2017-05-09 12:01 ` kbuild test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).