* [PATCH net-next] net: sunhme: move asm includes to below linux includes
@ 2023-04-05 17:29 Simon Horman
2023-04-05 17:34 ` Sean Anderson
2023-04-07 2:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 9+ messages in thread
From: Simon Horman @ 2023-04-05 17:29 UTC (permalink / raw)
To: Jakub Kicinski, David S. Miller, Eric Dumazet, Paolo Abeni
Cc: Sean Anderson, Geert Uytterhoeven, kernel test robot, netdev,
linux-kernel, Linux Memory Management List, linux-m68k
A recent rearrangement of includes has lead to a problem on m68k
as flagged by the kernel test robot.
Resolve this by moving the block asm includes to below linux includes.
A side effect i that non-Sparc asm includes are now immediately
before Sparc asm includes, which seems nice.
Using sparse v0.6.4 I was able to reproduce this problem as follows
using the config provided by the kernel test robot:
$ wget https://download.01.org/0day-ci/archive/20230404/202304041748.0sQc4K4l-lkp@intel.com/config
$ cp config .config
$ make ARCH=m68k oldconfig
$ make ARCH=m68k C=2 M=drivers/net/ethernet/sun
CC [M] drivers/net/ethernet/sun/sunhme.o
In file included from drivers/net/ethernet/sun/sunhme.c:19:
./arch/m68k/include/asm/irq.h:78:11: error: expected ‘;’ before ‘void’
78 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs);
| ^~~~~
| ;
./arch/m68k/include/asm/irq.h:78:40: warning: ‘struct pt_regs’ declared inside parameter list will not be visible outside of this definition or declaration
78 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs);
| ^~~~~~~
Compile tested only.
Fixes: 1ff4f42aef60 ("net: sunhme: Alphabetize includes")
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202304041748.0sQc4K4l-lkp@intel.com/
Signed-off-by: Simon Horman <horms@kernel.org>
---
drivers/net/ethernet/sun/sunhme.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
index ec85aef35bf9..b93613cd1994 100644
--- a/drivers/net/ethernet/sun/sunhme.c
+++ b/drivers/net/ethernet/sun/sunhme.c
@@ -14,9 +14,6 @@
* argument : macaddr=0x00,0x10,0x20,0x30,0x40,0x50
*/
-#include <asm/byteorder.h>
-#include <asm/dma.h>
-#include <asm/irq.h>
#include <linux/bitops.h>
#include <linux/crc32.h>
#include <linux/delay.h>
@@ -45,6 +42,10 @@
#include <linux/types.h>
#include <linux/uaccess.h>
+#include <asm/byteorder.h>
+#include <asm/dma.h>
+#include <asm/irq.h>
+
#ifdef CONFIG_SPARC
#include <asm/auxio.h>
#include <asm/idprom.h>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next] net: sunhme: move asm includes to below linux includes
2023-04-05 17:29 [PATCH net-next] net: sunhme: move asm includes to below linux includes Simon Horman
@ 2023-04-05 17:34 ` Sean Anderson
2023-04-05 18:02 ` Simon Horman
2023-04-07 2:10 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 9+ messages in thread
From: Sean Anderson @ 2023-04-05 17:34 UTC (permalink / raw)
To: Simon Horman, Jakub Kicinski, David S. Miller, Eric Dumazet, Paolo Abeni
Cc: Geert Uytterhoeven, kernel test robot, netdev, linux-kernel,
Linux Memory Management List, linux-m68k
On 4/5/23 13:29, Simon Horman wrote:
> A recent rearrangement of includes has lead to a problem on m68k
> as flagged by the kernel test robot.
>
> Resolve this by moving the block asm includes to below linux includes.
> A side effect i that non-Sparc asm includes are now immediately
> before Sparc asm includes, which seems nice.
>
> Using sparse v0.6.4 I was able to reproduce this problem as follows
> using the config provided by the kernel test robot:
>
> $ wget https://download.01.org/0day-ci/archive/20230404/202304041748.0sQc4K4l-lkp@intel.com/config
> $ cp config .config
> $ make ARCH=m68k oldconfig
> $ make ARCH=m68k C=2 M=drivers/net/ethernet/sun
> CC [M] drivers/net/ethernet/sun/sunhme.o
> In file included from drivers/net/ethernet/sun/sunhme.c:19:
> ./arch/m68k/include/asm/irq.h:78:11: error: expected ‘;’ before ‘void’
> 78 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs);
> | ^~~~~
> | ;
> ./arch/m68k/include/asm/irq.h:78:40: warning: ‘struct pt_regs’ declared inside parameter list will not be visible outside of this definition or declaration
> 78 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs);
> | ^~~~~~~
This seems like a problem with the header. m68k's asm/irq.h should include linux/interrupt.h before its declarations.
--Sean
> Compile tested only.
>
> Fixes: 1ff4f42aef60 ("net: sunhme: Alphabetize includes")
> Reported-by: kernel test robot <lkp@intel.com>
> Link: https://lore.kernel.org/oe-kbuild-all/202304041748.0sQc4K4l-lkp@intel.com/
> Signed-off-by: Simon Horman <horms@kernel.org>
> ---
> drivers/net/ethernet/sun/sunhme.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
> index ec85aef35bf9..b93613cd1994 100644
> --- a/drivers/net/ethernet/sun/sunhme.c
> +++ b/drivers/net/ethernet/sun/sunhme.c
> @@ -14,9 +14,6 @@
> * argument : macaddr=0x00,0x10,0x20,0x30,0x40,0x50
> */
>
> -#include <asm/byteorder.h>
> -#include <asm/dma.h>
> -#include <asm/irq.h>
> #include <linux/bitops.h>
> #include <linux/crc32.h>
> #include <linux/delay.h>
> @@ -45,6 +42,10 @@
> #include <linux/types.h>
> #include <linux/uaccess.h>
>
> +#include <asm/byteorder.h>
> +#include <asm/dma.h>
> +#include <asm/irq.h>
> +
> #ifdef CONFIG_SPARC
> #include <asm/auxio.h>
> #include <asm/idprom.h>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next] net: sunhme: move asm includes to below linux includes
2023-04-05 17:34 ` Sean Anderson
@ 2023-04-05 18:02 ` Simon Horman
2023-04-05 18:07 ` Matthew Wilcox
0 siblings, 1 reply; 9+ messages in thread
From: Simon Horman @ 2023-04-05 18:02 UTC (permalink / raw)
To: Sean Anderson
Cc: Jakub Kicinski, David S. Miller, Eric Dumazet, Paolo Abeni,
Geert Uytterhoeven, kernel test robot, netdev, linux-kernel,
Linux Memory Management List, linux-m68k
On Wed, Apr 05, 2023 at 01:34:11PM -0400, Sean Anderson wrote:
> On 4/5/23 13:29, Simon Horman wrote:
> > A recent rearrangement of includes has lead to a problem on m68k
> > as flagged by the kernel test robot.
> >
> > Resolve this by moving the block asm includes to below linux includes.
> > A side effect i that non-Sparc asm includes are now immediately
> > before Sparc asm includes, which seems nice.
> >
> > Using sparse v0.6.4 I was able to reproduce this problem as follows
> > using the config provided by the kernel test robot:
> >
> > $ wget https://download.01.org/0day-ci/archive/20230404/202304041748.0sQc4K4l-lkp@intel.com/config
> > $ cp config .config
> > $ make ARCH=m68k oldconfig
> > $ make ARCH=m68k C=2 M=drivers/net/ethernet/sun
> > CC [M] drivers/net/ethernet/sun/sunhme.o
> > In file included from drivers/net/ethernet/sun/sunhme.c:19:
> > ./arch/m68k/include/asm/irq.h:78:11: error: expected ‘;’ before ‘void’
> > 78 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs);
> > | ^~~~~
> > | ;
> > ./arch/m68k/include/asm/irq.h:78:40: warning: ‘struct pt_regs’ declared inside parameter list will not be visible outside of this definition or declaration
> > 78 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs);
> > | ^~~~~~~
>
> This seems like a problem with the header. m68k's asm/irq.h should include linux/interrupt.h before its declarations.
Hi Sean,
I do see your point. But TBH I'm unsure which way to go on this one.
Geert, do you have any input?
> --Sean
>
> > Compile tested only.
> >
> > Fixes: 1ff4f42aef60 ("net: sunhme: Alphabetize includes")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Link: https://lore.kernel.org/oe-kbuild-all/202304041748.0sQc4K4l-lkp@intel.com/
> > Signed-off-by: Simon Horman <horms@kernel.org>
> > ---
> > drivers/net/ethernet/sun/sunhme.c | 7 ++++---
> > 1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
> > index ec85aef35bf9..b93613cd1994 100644
> > --- a/drivers/net/ethernet/sun/sunhme.c
> > +++ b/drivers/net/ethernet/sun/sunhme.c
> > @@ -14,9 +14,6 @@
> > * argument : macaddr=0x00,0x10,0x20,0x30,0x40,0x50
> > */
> > -#include <asm/byteorder.h>
> > -#include <asm/dma.h>
> > -#include <asm/irq.h>
> > #include <linux/bitops.h>
> > #include <linux/crc32.h>
> > #include <linux/delay.h>
> > @@ -45,6 +42,10 @@
> > #include <linux/types.h>
> > #include <linux/uaccess.h>
> > +#include <asm/byteorder.h>
> > +#include <asm/dma.h>
> > +#include <asm/irq.h>
> > +
> > #ifdef CONFIG_SPARC
> > #include <asm/auxio.h>
> > #include <asm/idprom.h>
> >
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next] net: sunhme: move asm includes to below linux includes
2023-04-05 18:02 ` Simon Horman
@ 2023-04-05 18:07 ` Matthew Wilcox
2023-04-05 18:09 ` Sean Anderson
0 siblings, 1 reply; 9+ messages in thread
From: Matthew Wilcox @ 2023-04-05 18:07 UTC (permalink / raw)
To: Simon Horman
Cc: Sean Anderson, Jakub Kicinski, David S. Miller, Eric Dumazet,
Paolo Abeni, Geert Uytterhoeven, kernel test robot, netdev,
linux-kernel, Linux Memory Management List, linux-m68k
On Wed, Apr 05, 2023 at 08:02:37PM +0200, Simon Horman wrote:
> On Wed, Apr 05, 2023 at 01:34:11PM -0400, Sean Anderson wrote:
> > On 4/5/23 13:29, Simon Horman wrote:
> > > A recent rearrangement of includes has lead to a problem on m68k
> > > as flagged by the kernel test robot.
> > >
> > > Resolve this by moving the block asm includes to below linux includes.
> > > A side effect i that non-Sparc asm includes are now immediately
> > > before Sparc asm includes, which seems nice.
> > >
> > > Using sparse v0.6.4 I was able to reproduce this problem as follows
> > > using the config provided by the kernel test robot:
> > >
> > > $ wget https://download.01.org/0day-ci/archive/20230404/202304041748.0sQc4K4l-lkp@intel.com/config
> > > $ cp config .config
> > > $ make ARCH=m68k oldconfig
> > > $ make ARCH=m68k C=2 M=drivers/net/ethernet/sun
> > > CC [M] drivers/net/ethernet/sun/sunhme.o
> > > In file included from drivers/net/ethernet/sun/sunhme.c:19:
> > > ./arch/m68k/include/asm/irq.h:78:11: error: expected ‘;’ before ‘void’
> > > 78 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs);
> > > | ^~~~~
> > > | ;
> > > ./arch/m68k/include/asm/irq.h:78:40: warning: ‘struct pt_regs’ declared inside parameter list will not be visible outside of this definition or declaration
> > > 78 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs);
> > > | ^~~~~~~
> >
> > This seems like a problem with the header. m68k's asm/irq.h should include linux/interrupt.h before its declarations.
>
> Hi Sean,
>
> I do see your point. But TBH I'm unsure which way to go on this one.
> Geert, do you have any input?
We always include linux/* headers before asm/*. The "sorting" of
headers in this way was inappropriate.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next] net: sunhme: move asm includes to below linux includes
2023-04-05 18:07 ` Matthew Wilcox
@ 2023-04-05 18:09 ` Sean Anderson
2023-04-05 18:34 ` Matthew Wilcox
0 siblings, 1 reply; 9+ messages in thread
From: Sean Anderson @ 2023-04-05 18:09 UTC (permalink / raw)
To: Matthew Wilcox, Simon Horman
Cc: Jakub Kicinski, David S. Miller, Eric Dumazet, Paolo Abeni,
Geert Uytterhoeven, kernel test robot, netdev, linux-kernel,
Linux Memory Management List, linux-m68k
On 4/5/23 14:07, Matthew Wilcox wrote:
> On Wed, Apr 05, 2023 at 08:02:37PM +0200, Simon Horman wrote:
>> On Wed, Apr 05, 2023 at 01:34:11PM -0400, Sean Anderson wrote:
>>> On 4/5/23 13:29, Simon Horman wrote:
>>>> A recent rearrangement of includes has lead to a problem on m68k
>>>> as flagged by the kernel test robot.
>>>>
>>>> Resolve this by moving the block asm includes to below linux includes.
>>>> A side effect i that non-Sparc asm includes are now immediately
>>>> before Sparc asm includes, which seems nice.
>>>>
>>>> Using sparse v0.6.4 I was able to reproduce this problem as follows
>>>> using the config provided by the kernel test robot:
>>>>
>>>> $ wget https://download.01.org/0day-ci/archive/20230404/202304041748.0sQc4K4l-lkp@intel.com/config
>>>> $ cp config .config
>>>> $ make ARCH=m68k oldconfig
>>>> $ make ARCH=m68k C=2 M=drivers/net/ethernet/sun
>>>> CC [M] drivers/net/ethernet/sun/sunhme.o
>>>> In file included from drivers/net/ethernet/sun/sunhme.c:19:
>>>> ./arch/m68k/include/asm/irq.h:78:11: error: expected ‘;’ before ‘void’
>>>> 78 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs);
>>>> | ^~~~~
>>>> | ;
>>>> ./arch/m68k/include/asm/irq.h:78:40: warning: ‘struct pt_regs’ declared inside parameter list will not be visible outside of this definition or declaration
>>>> 78 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs);
>>>> | ^~~~~~~
>>>
>>> This seems like a problem with the header. m68k's asm/irq.h should include linux/interrupt.h before its declarations.
>>
>> Hi Sean,
>>
>> I do see your point. But TBH I'm unsure which way to go on this one.
>> Geert, do you have any input?
>
> We always include linux/* headers before asm/*. The "sorting" of
> headers in this way was inappropriate.
Is this written down anywhere? I couldn't find it in Documentation/process...
--Sean
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next] net: sunhme: move asm includes to below linux includes
2023-04-05 18:09 ` Sean Anderson
@ 2023-04-05 18:34 ` Matthew Wilcox
2023-04-05 23:25 ` Jakub Kicinski
2023-04-06 12:10 ` Geert Uytterhoeven
0 siblings, 2 replies; 9+ messages in thread
From: Matthew Wilcox @ 2023-04-05 18:34 UTC (permalink / raw)
To: Sean Anderson
Cc: Simon Horman, Jakub Kicinski, David S. Miller, Eric Dumazet,
Paolo Abeni, Geert Uytterhoeven, kernel test robot, netdev,
linux-kernel, Linux Memory Management List, linux-m68k
On Wed, Apr 05, 2023 at 02:09:55PM -0400, Sean Anderson wrote:
> On 4/5/23 14:07, Matthew Wilcox wrote:
> > We always include linux/* headers before asm/*. The "sorting" of
> > headers in this way was inappropriate.
>
> Is this written down anywhere? I couldn't find it in Documentation/process...
Feel free to send a patch. Generally, it should be:
#include <linux/foo.h>
#include <linux/bar.h>
#include <asm/baz.h>
#include <asm/quux.h>
#include "local.h"
Some drivers do this a different way with a single local.h that includes
all necessary includes.
Also if <linux/foo.h> and <asm/foo.h> both exist, you should include
<linux/foo.h> (which almost certainly includes <asm/foo.h>)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next] net: sunhme: move asm includes to below linux includes
2023-04-05 18:34 ` Matthew Wilcox
@ 2023-04-05 23:25 ` Jakub Kicinski
2023-04-06 12:10 ` Geert Uytterhoeven
1 sibling, 0 replies; 9+ messages in thread
From: Jakub Kicinski @ 2023-04-05 23:25 UTC (permalink / raw)
To: Sean Anderson
Cc: Matthew Wilcox, Simon Horman, David S. Miller, Eric Dumazet,
Paolo Abeni, Geert Uytterhoeven, kernel test robot, netdev,
linux-kernel, Linux Memory Management List, linux-m68k
On Wed, 5 Apr 2023 19:34:38 +0100 Matthew Wilcox wrote:
> On Wed, Apr 05, 2023 at 02:09:55PM -0400, Sean Anderson wrote:
> > On 4/5/23 14:07, Matthew Wilcox wrote:
> > > We always include linux/* headers before asm/*. The "sorting" of
> > > headers in this way was inappropriate.
> >
> > Is this written down anywhere? I couldn't find it in Documentation/process...
>
> Feel free to send a patch.
Patch to documentation, checkpatch or both :)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next] net: sunhme: move asm includes to below linux includes
2023-04-05 18:34 ` Matthew Wilcox
2023-04-05 23:25 ` Jakub Kicinski
@ 2023-04-06 12:10 ` Geert Uytterhoeven
1 sibling, 0 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2023-04-06 12:10 UTC (permalink / raw)
To: Matthew Wilcox
Cc: Sean Anderson, Simon Horman, Jakub Kicinski, David S. Miller,
Eric Dumazet, Paolo Abeni, kernel test robot, netdev,
linux-kernel, Linux Memory Management List, linux-m68k
Hi Willy,
On Wed, Apr 5, 2023 at 8:34 PM Matthew Wilcox <willy@infradead.org> wrote:
> On Wed, Apr 05, 2023 at 02:09:55PM -0400, Sean Anderson wrote:
> > On 4/5/23 14:07, Matthew Wilcox wrote:
> > > We always include linux/* headers before asm/*. The "sorting" of
> > > headers in this way was inappropriate.
> >
> > Is this written down anywhere? I couldn't find it in Documentation/process...
>
> Feel free to send a patch. Generally, it should be:
>
> #include <linux/foo.h>
> #include <linux/bar.h>
>
> #include <asm/baz.h>
> #include <asm/quux.h>
>
> #include "local.h"
>
> Some drivers do this a different way with a single local.h that includes
> all necessary includes.
>
> Also if <linux/foo.h> and <asm/foo.h> both exist, you should include
> <linux/foo.h> (which almost certainly includes <asm/foo.h>)
Indeed. Usually <asm/foo.h> should not be included directly,
except for a few exceptions like <asm/irq.h>.
Witness e.g. the (violated a lot) comment at the top of include/linux/irq.h:
/*
* Please do not include this file in generic code. There is currently
* no requirement for any architecture to implement anything held
* within this file.
*
* Thanks. --rmk
*/
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next] net: sunhme: move asm includes to below linux includes
2023-04-05 17:29 [PATCH net-next] net: sunhme: move asm includes to below linux includes Simon Horman
2023-04-05 17:34 ` Sean Anderson
@ 2023-04-07 2:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 9+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-04-07 2:10 UTC (permalink / raw)
To: Simon Horman
Cc: kuba, davem, edumazet, pabeni, seanga2, geert, lkp, netdev,
linux-kernel, linux-mm, linux-m68k
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 05 Apr 2023 19:29:48 +0200 you wrote:
> A recent rearrangement of includes has lead to a problem on m68k
> as flagged by the kernel test robot.
>
> Resolve this by moving the block asm includes to below linux includes.
> A side effect i that non-Sparc asm includes are now immediately
> before Sparc asm includes, which seems nice.
>
> [...]
Here is the summary with links:
- [net-next] net: sunhme: move asm includes to below linux includes
https://git.kernel.org/netdev/net-next/c/f8b648bf6628
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-04-07 2:10 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-05 17:29 [PATCH net-next] net: sunhme: move asm includes to below linux includes Simon Horman
2023-04-05 17:34 ` Sean Anderson
2023-04-05 18:02 ` Simon Horman
2023-04-05 18:07 ` Matthew Wilcox
2023-04-05 18:09 ` Sean Anderson
2023-04-05 18:34 ` Matthew Wilcox
2023-04-05 23:25 ` Jakub Kicinski
2023-04-06 12:10 ` Geert Uytterhoeven
2023-04-07 2:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox