All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] vlan:remove duplicate <linux/if_vlan.h>
@ 2011-07-28  8:37 Weiping Pan
  2011-07-28  8:37 ` [PATCH net-next 1/2] stp:add netdevice.h into stp.h Weiping Pan
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Weiping Pan @ 2011-07-28  8:37 UTC (permalink / raw)
  To: netdev; +Cc: Weiping Pan

As net/8021q/vlan.h already includes <linux/if_vlan.h>,
so other files that includes vlan.h need not to include it.

But before we remove it from net/8021q/vlan_gvrp.c,
we should first add add netdevice.h into stp.h.

[PATCH net-next 1/2]:add netdevice.h into stp.h
[PATCH net-next 2/2]:remove duplicate <linux/if_vlan.h>

Weiping Pan (2):
  stp:add netdevice.h into stp.h
  vlan:remove duplicate <linux/if_vlan.h>

 include/net/stp.h        |    2 ++
 net/8021q/vlan.c         |    1 -
 net/8021q/vlan_core.c    |    1 -
 net/8021q/vlan_dev.c     |    1 -
 net/8021q/vlan_gvrp.c    |    1 -
 net/8021q/vlan_netlink.c |    1 -
 net/8021q/vlanproc.c     |    1 -
 7 files changed, 2 insertions(+), 6 deletions(-)

-- 
1.7.4.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net-next 1/2] stp:add netdevice.h into stp.h
  2011-07-28  8:37 [PATCH net-next 0/2] vlan:remove duplicate <linux/if_vlan.h> Weiping Pan
@ 2011-07-28  8:37 ` Weiping Pan
  2011-07-28  8:37 ` [PATCH net-next 2/2] vlan:remove duplicate <linux/if_vlan.h> Weiping Pan
  2011-07-28  8:38 ` [PATCH net-next 0/2] " David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: Weiping Pan @ 2011-07-28  8:37 UTC (permalink / raw)
  To: netdev; +Cc: Weiping Pan

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 <panweiping3@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net-next 2/2] vlan:remove duplicate <linux/if_vlan.h>
  2011-07-28  8:37 [PATCH net-next 0/2] vlan:remove duplicate <linux/if_vlan.h> Weiping Pan
  2011-07-28  8:37 ` [PATCH net-next 1/2] stp:add netdevice.h into stp.h Weiping Pan
@ 2011-07-28  8:37 ` Weiping Pan
  2011-07-28  8:38 ` [PATCH net-next 0/2] " David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: Weiping Pan @ 2011-07-28  8:37 UTC (permalink / raw)
  To: netdev; +Cc: Weiping Pan

As net/8021q/vlan.h already includes <linux/if_vlan.h>,
so other files that includes vlan.h need not to include it.

Signed-off-by: Weiping Pan <panweiping3@gmail.com>
---
 net/8021q/vlan.c         |    1 -
 net/8021q/vlan_core.c    |    1 -
 net/8021q/vlan_dev.c     |    1 -
 net/8021q/vlan_gvrp.c    |    1 -
 net/8021q/vlan_netlink.c |    1 -
 net/8021q/vlanproc.c     |    1 -
 6 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 8970ba1..60030b6 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -36,7 +36,6 @@
 #include <net/netns/generic.h>
 #include <asm/uaccess.h>
 
-#include <linux/if_vlan.h>
 #include "vlan.h"
 #include "vlanproc.h"
 
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index 5f27f8e..66190dc 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -1,6 +1,5 @@
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
-#include <linux/if_vlan.h>
 #include <linux/netpoll.h>
 #include "vlan.h"
 
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 934e221..1793ffb 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -32,7 +32,6 @@
 
 #include "vlan.h"
 #include "vlanproc.h"
-#include <linux/if_vlan.h>
 
 /*
  *	Rebuild the Ethernet MAC header. This is called after an ARP
diff --git a/net/8021q/vlan_gvrp.c b/net/8021q/vlan_gvrp.c
index 061cece..6153c72 100644
--- a/net/8021q/vlan_gvrp.c
+++ b/net/8021q/vlan_gvrp.c
@@ -8,7 +8,6 @@
  *	version 2 as published by the Free Software Foundation.
  */
 #include <linux/types.h>
-#include <linux/if_vlan.h>
 #include <net/garp.h>
 #include "vlan.h"
 
diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c
index be9a5c1..687ee4f 100644
--- a/net/8021q/vlan_netlink.c
+++ b/net/8021q/vlan_netlink.c
@@ -10,7 +10,6 @@
 
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
-#include <linux/if_vlan.h>
 #include <net/net_namespace.h>
 #include <net/netlink.h>
 #include <net/rtnetlink.h>
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index d34b6da..47c99c8 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -27,7 +27,6 @@
 #include <linux/seq_file.h>
 #include <linux/fs.h>
 #include <linux/netdevice.h>
-#include <linux/if_vlan.h>
 #include <net/net_namespace.h>
 #include <net/netns/generic.h>
 #include "vlanproc.h"
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 0/2] vlan:remove duplicate <linux/if_vlan.h>
  2011-07-28  8:37 [PATCH net-next 0/2] vlan:remove duplicate <linux/if_vlan.h> Weiping Pan
  2011-07-28  8:37 ` [PATCH net-next 1/2] stp:add netdevice.h into stp.h Weiping Pan
  2011-07-28  8:37 ` [PATCH net-next 2/2] vlan:remove duplicate <linux/if_vlan.h> Weiping Pan
@ 2011-07-28  8:38 ` David Miller
  2011-07-28  8:48   ` WeipingPan
  2 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2011-07-28  8:38 UTC (permalink / raw)
  To: panweiping3; +Cc: netdev

From: Weiping Pan <panweiping3@gmail.com>
Date: Thu, 28 Jul 2011 16:37:38 +0800

> As net/8021q/vlan.h already includes <linux/if_vlan.h>,
> so other files that includes vlan.h need not to include it.

Please do not do this.

If someone wants to remove this implicit header dependency,
that someone will need to add all of the includes back.

It is better for people to include all the headers they need,
rather than rely upon such indirect inclusions.

I am not applying these patches.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 0/2] vlan:remove duplicate <linux/if_vlan.h>
  2011-07-28  8:38 ` [PATCH net-next 0/2] " David Miller
@ 2011-07-28  8:48   ` WeipingPan
  0 siblings, 0 replies; 5+ messages in thread
From: WeipingPan @ 2011-07-28  8:48 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

On 07/28/2011 04:38 PM, David Miller wrote:
> From: Weiping Pan<panweiping3@gmail.com>
> Date: Thu, 28 Jul 2011 16:37:38 +0800
>
>> As net/8021q/vlan.h already includes<linux/if_vlan.h>,
>> so other files that includes vlan.h need not to include it.
> Please do not do this.
>
> If someone wants to remove this implicit header dependency,
> that someone will need to add all of the includes back.
>
> It is better for people to include all the headers they need,
> rather than rely upon such indirect inclusions.
Ok, thanks.

Weiping Pan
> I am not applying these patches.
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-07-28  8:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-28  8:37 [PATCH net-next 0/2] vlan:remove duplicate <linux/if_vlan.h> Weiping Pan
2011-07-28  8:37 ` [PATCH net-next 1/2] stp:add netdevice.h into stp.h Weiping Pan
2011-07-28  8:37 ` [PATCH net-next 2/2] vlan:remove duplicate <linux/if_vlan.h> Weiping Pan
2011-07-28  8:38 ` [PATCH net-next 0/2] " David Miller
2011-07-28  8:48   ` WeipingPan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.