net: sh_eth: fix build failure
Subsystems (4)
PATCH 1/1 net: sh_eth: fix build failure
The following commit removed some including headers:
"net: sh_eth: move the asm/sh_eth.h to include/linux/" (commit id: d4fa0e35fdbd54acf791fa3793d6d17f7795f7ae)
Then, the build failure happened on the linux-next:
drivers/net/ethernet/renesas/sh_eth.c:601: error: 'THIS_MODULE' undeclared here (not in a function) drivers/net/ethernet/renesas/sh_eth.c:1970: error: expected declaration specifiers or '...' before string constant drivers/net/ethernet/renesas/sh_eth.c:1970: warning: data definition has no type or storage class drivers/net/ethernet/renesas/sh_eth.c:1970: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR' drivers/net/ethernet/renesas/sh_eth.c:1970: warning: function declaration isn't a prototype drivers/net/ethernet/renesas/sh_eth.c:1971: error: expected declaration specifiers or '...' before string constant drivers/net/ethernet/renesas/sh_eth.c:1971: warning: data definition has no type or storage class drivers/net/ethernet/renesas/sh_eth.c:1971: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION' drivers/net/ethernet/renesas/sh_eth.c:1971: warning: function declaration isn't a prototype drivers/net/ethernet/renesas/sh_eth.c:1972: error: expected declaration specifiers or '...' before string constant drivers/net/ethernet/renesas/sh_eth.c:1972: warning: data definition has no type or storage class drivers/net/ethernet/renesas/sh_eth.c:1972: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE' drivers/net/ethernet/renesas/sh_eth.c:1972: warning: function declaration isn't a prototype
This patch fixes the issue. This patch also get back include/kernel.h and linux/spinlock.h.
--- drivers/net/ethernet/renesas/sh_eth.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/ethernet/renesas/sh_eth.c +3 -0
@@ -21,6 +21,9 @@*/ #include <linux/init.h> +#include <linux/module.h> +#include <linux/kernel.h> +#include <linux/spinlock.h> #include <linux/interrupt.h> #include <linux/dma-mapping.h> #include <linux/etherdevice.h>
Signature · 1 line
1.7.1
2011/9/30 Yoshihiro Shimoda <[email protected]>:
Quoted 34 lines
The following commit removed some including headers:
"net:sh_eth: move theasm/sh_eth.htoinclude/linux/" (commit id:d4fa0e35fdbd54acf791fa3793d6d17f7795f7ae)Then, the build failure happened on the linux-next:
drivers/net/ethernet/renesas/sh_eth.c:601: error: 'THIS_MODULE' undeclared here (not in a function)drivers/net/ethernet/renesas/sh_eth.c:1970: error: expected declaration specifiers or '...' before string constantdrivers/net/ethernet/renesas/sh_eth.c:1970: warning: data definition has no type or storage classdrivers/net/ethernet/renesas/sh_eth.c:1970: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'drivers/net/ethernet/renesas/sh_eth.c:1970: warning: function declaration isn't a prototypedrivers/net/ethernet/renesas/sh_eth.c:1971: error: expected declaration specifiers or '...' before string constantdrivers/net/ethernet/renesas/sh_eth.c:1971: warning: data definition has no type or storage classdrivers/net/ethernet/renesas/sh_eth.c:1971: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION'drivers/net/ethernet/renesas/sh_eth.c:1971: warning: function declaration isn't a prototypedrivers/net/ethernet/renesas/sh_eth.c:1972: error: expected declaration specifiers or '...' before string constantdrivers/net/ethernet/renesas/sh_eth.c:1972: warning: data definition has no type or storage classdrivers/net/ethernet/renesas/sh_eth.c:1972: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'drivers/net/ethernet/renesas/sh_eth.c:1972: warning: function declaration isn't a prototypeThis patch fixes the issue. This patch also get back
include/kernel.handlinux/spinlock.h.Reported-by Stephen Rothwell <[email protected]>Signed-off-by Yoshihiro Shimoda <[email protected]>---
drivers/net/ethernet/renesas/sh_eth.c | 3 +++1 files changed, 3 insertions(+), 0 deletions(-)drivers/net/ethernet/renesas/sh_eth.c +0
-0
drivers/net/ethernet/renesas/sh_eth.c line 24
Quoted 4 lines
drivers/net/ethernet/renesas/sh_eth.c +1
-0@@ -21,6 +21,9 @@*/ #include <linux/init.h> +#include <linux/module.h>
This is required.
drivers/net/ethernet/renesas/sh_eth.c line 26
Quoted 2 lines
drivers/net/ethernet/renesas/sh_eth.c +2
-0+#include <linux/kernel.h> +#include <linux/spinlock.h>
These are not required.
drivers/net/ethernet/renesas/sh_eth.c line 29
Quoted 3 lines
drivers/net/ethernet/renesas/sh_eth.c +0
-0#include <linux/interrupt.h> #include <linux/dma-mapping.h> #include <linux/etherdevice.h>
Best regards,
Nobuhiro
Nobuhiro Iwamatsu
Quoted 1 line · Nobuhiro Iwamatsu
2011/9/30 Yoshihiro Shimoda <[email protected]>:
< snip >
Quoted 3 lines
drivers/net/ethernet/renesas/sh_eth.c line 26
Quoted 2 lines
drivers/net/ethernet/renesas/sh_eth.c +2
-0+#include <linux/kernel.h> +#include <linux/spinlock.h> These are not required.
The Documentation/SubmitChecklist says the following:
============================
1: If you use a facility then #include the file that defines/declares
that facility. Don't depend on other header files pulling in ones that you use.
============================
The sh_eth driver uses spinlock functions and some macros of kernel.h. So, I think that I have to write their "#include" in the driver.
Best regards,
Yoshihiro Shimoda
Quoted 5 lines
Best regards,
Nobuhiro
Nobuhiro Iwamatsu
David Miller
maintainerFrom: Yoshihiro Shimoda <[email protected]>
Date: Fri, 30 Sep 2011 16:51:34 +0900
Quoted 9 lines
Quoted 1 line · Nobuhiro Iwamatsu
2011/9/30 Yoshihiro Shimoda <[email protected]>:
< snip >
Quoted 3 lines
drivers/net/ethernet/renesas/sh_eth.c line 26
Quoted 2 lines
drivers/net/ethernet/renesas/sh_eth.c +2
-0+#include <linux/kernel.h> +#include <linux/spinlock.h> These are not required.
The
Documentation/SubmitChecklistsays the following:
Quoted 8 lines
============================
1: If you use a facility then #include the file that defines/declares
that facility. Don't depend on other header files pulling in ones that you use.
============================The
sh_ethdriver uses spinlock functions and some macros ofkernel.h. So, I think that I have to write their "#include" in the driver.
Agreed.
I see.
Thanks you.
Nobuhiro
2011/9/30 David Miller <[email protected]>:
Quoted 27 lines
From: Yoshihiro Shimoda <[email protected]>
Date: Fri, 30 Sep 2011 16:51:34 +0900Quoted 9 lines
Quoted 1 line · Nobuhiro Iwamatsu
2011/9/30 Yoshihiro Shimoda <[email protected]>:
< snip >
Quoted 3 lines
drivers/net/ethernet/renesas/sh_eth.c line 26
Quoted 2 lines
drivers/net/ethernet/renesas/sh_eth.c +2
-0+#include <linux/kernel.h> +#include <linux/spinlock.h> These are not required.
The
Documentation/SubmitChecklistsays the following:Quoted 8 lines
============================
1: If you use a facility then #include the file that defines/declares that facility. Don't depend on other header files pulling in ones that you use.
============================The
sh_ethdriver uses spinlock functions and some macros ofkernel.h. So, I think that I have to write their "#include" in the driver.Agreed.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Nobuhiro Iwamatsu
From: Yoshihiro Shimoda <[email protected]>
Date: Fri, 30 Sep 2011 12:16:57 +0900
Quoted 5 lines
The following commit removed some including headers:
"net:sh_eth: move theasm/sh_eth.htoinclude/linux/" (commit id:d4fa0e35fdbd54acf791fa3793d6d17f7795f7ae)Then, the build failure happened on the linux-next:
...
Quoted 5 lines
This patch fixes the issue. This patch also get back
include/kernel.handlinux/spinlock.h.Reported-by Stephen Rothwell <[email protected]>Signed-off-by Yoshihiro Shimoda <[email protected]>
Applied, thanks.