[PATCH net-next 1/2] stp:add netdevice.h into stp.h
From: Weiping Pan <hidden>
Date: 2011-07-28 08:36:25
Subsystem:
networking [general], the rest · Maintainers:
"David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds
We don't meet a compile error becasue <linux/netdevice.h>
is added by ohter header files, luckily.
I find this problem when I want to remove the duplicate <linux/if_vlan.h>.
As net/8021q/vlan.h already includes it, so other files that includes vlan.h
need not to include it.
But when I remove <linux/if_vlan.h> from net/8021q/vlan_gvrp.c,
I met a compile error.
[pwp@localhost net-next]$ make O=../net-next_build/ M=net/8021q
CC net/8021q/vlan_core.o
LD net/8021q/built-in.o
CC [M] net/8021q/vlan.o
CC [M] net/8021q/vlan_dev.o
CC [M] net/8021q/vlan_netlink.o
CC [M] net/8021q/vlan_gvrp.o
In file included from /home/pwp/mysvn/linux/net-next/include/net/garp.h:4:0,
from /home/pwp/mysvn/linux/net-next/net/8021q/vlan_gvrp.c:12:
/home/pwp/mysvn/linux/net-next/include/net/stp.h:5:30: error: ‘ETH_ALEN’ undeclared here (not in a function)
/home/pwp/mysvn/linux/net-next/include/net/stp.h:7:18: warning: ‘struct net_device’ declared inside parameter list
/home/pwp/mysvn/linux/net-next/include/net/stp.h:7:18: warning: its scope is only this definition or declaration, which is probably not what you want
/home/pwp/mysvn/linux/net-next/include/net/stp.h:7:18: warning: ‘struct sk_buff’ declared inside parameter list
In file included from /home/pwp/mysvn/linux/net-next/net/8021q/vlan_gvrp.c:12:0:
/home/pwp/mysvn/linux/net-next/include/net/garp.h:36:50: warning: ‘struct sk_buff’ declared inside parameter list
/home/pwp/mysvn/linux/net-next/include/net/garp.h: In function ‘garp_cb’:
/home/pwp/mysvn/linux/net-next/include/net/garp.h:38:2: error: implicit declaration of function ‘BUILD_BUG_ON’
/home/pwp/mysvn/linux/net-next/include/net/garp.h:39:8: error: implicit declaration of function ‘FIELD_SIZEOF’
/home/pwp/mysvn/linux/net-next/include/net/garp.h:39:21: error: expected expression before ‘struct’
/home/pwp/mysvn/linux/net-next/include/net/garp.h:40:34: error: dereferencing pointer to incomplete type
/home/pwp/mysvn/linux/net-next/include/net/garp.h: At top level:
/home/pwp/mysvn/linux/net-next/include/net/garp.h:79:19: error: field ‘node’ has incomplete type
/home/pwp/mysvn/linux/net-next/include/net/garp.h:101:20: error: field ‘join_timer’ has incomplete type
/home/pwp/mysvn/linux/net-next/include/net/garp.h:103:2: error: expected specifier-qualifier-list before ‘spinlock_t’
/home/pwp/mysvn/linux/net-next/include/net/garp.h:112:20: error: field ‘rcu’ has incomplete type
make[2]: *** [net/8021q/vlan_gvrp.o] Error 1
make[1]: *** [_module_net/8021q] Error 2
make: *** [sub-make] Error 2
Signed-off-by: Weiping Pan <redacted>
---
include/net/stp.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/net/stp.h b/include/net/stp.h
index ad447f1..13318f3 100644
--- a/include/net/stp.h
+++ b/include/net/stp.h@@ -1,6 +1,8 @@ #ifndef _NET_STP_H #define _NET_STP_H +#include <linux/netdevice.h> + struct stp_proto { unsigned char group_address[ETH_ALEN]; void (*rcv)(const struct stp_proto *, struct sk_buff *,
--
1.7.4.4