[PATCH] net: sh_eth: fix build failure

Subsystems: networking drivers, renesas superh ethernet driver, the rest

STALE5493d

6 messages, 3 authors, 2011-10-03 · open the first message on its own page

[PATCH] net: sh_eth: fix build failure

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: 2011-09-30 03:18:54

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.

Reported-by: Stephen Rothwell <redacted>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/net/ethernet/renesas/sh_eth.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 6aa0704..9b23074 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -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>
-- 
1.7.1

Re: [PATCH] net: sh_eth: fix build failure

From: Nobuhiro Iwamatsu <hidden>
Date: 2011-09-30 06:55:39

2011/9/30 Yoshihiro Shimoda [off-list ref]:
quoted hunk
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.

Reported-by: Stephen Rothwell <redacted>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/net/ethernet/renesas/sh_eth.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 6aa0704..9b23074 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -21,6 +21,9 @@
 */

 #include <linux/init.h>
+#include <linux/module.h>
This is required.
+#include <linux/kernel.h>
+#include <linux/spinlock.h>
These are not required.
 #include <linux/interrupt.h>
 #include <linux/dma-mapping.h>
 #include <linux/etherdevice.h>
Best regards,
  Nobuhiro
Nobuhiro Iwamatsu

Re: [PATCH] net: sh_eth: fix build failure

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: 2011-09-30 07:51:34

2011/09/30 15:55, Nobuhiro Iwamatsu wrote:
2011/9/30 Yoshihiro Shimoda [off-list ref]:
< snip >
quoted
+#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
Best regards,
  Nobuhiro
Nobuhiro Iwamatsu

Re: [PATCH] net: sh_eth: fix build failure

From: David Miller <davem@davemloft.net>
Date: 2011-09-30 07:54:49

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Fri, 30 Sep 2011 16:51:34 +0900
2011/09/30 15:55, Nobuhiro Iwamatsu wrote:
quoted
2011/9/30 Yoshihiro Shimoda [off-list ref]:
< snip >
quoted
quoted
+#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.
Agreed.

Re: [PATCH] net: sh_eth: fix build failure

From: Nobuhiro Iwamatsu <hidden>
Date: 2011-09-30 19:36:53

I see.
Thanks you.

Nobuhiro

2011/9/30 David Miller [off-list ref]:
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Fri, 30 Sep 2011 16:51:34 +0900
quoted
2011/09/30 15:55, Nobuhiro Iwamatsu wrote:
quoted
2011/9/30 Yoshihiro Shimoda [off-list ref]:
< snip >
quoted
quoted
+#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.
Agreed.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Nobuhiro Iwamatsu

Re: [PATCH] net: sh_eth: fix build failure

From: David Miller <davem@davemloft.net>
Date: 2011-10-03 18:00:02

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Fri, 30 Sep 2011 12:16:57 +0900
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:
 ...
This patch fixes the issue. This patch also get back include/kernel.h
and linux/spinlock.h.

Reported-by: Stephen Rothwell <redacted>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help