* [patch 0/2] veth: veth pair device code cleanup
@ 2008-10-28 21:11 Daniel Lezcano
2008-10-28 21:11 ` [patch 1/2] veth: Remove useless veth field Daniel Lezcano
2008-10-28 21:11 ` [patch 2/2] veth: remove unused list Daniel Lezcano
0 siblings, 2 replies; 5+ messages in thread
From: Daniel Lezcano @ 2008-10-28 21:11 UTC (permalink / raw)
To: davem; +Cc: netdev, xemul
The next two patches remove some unused code in the veth pair network device.
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* [patch 1/2] veth: Remove useless veth field
2008-10-28 21:11 [patch 0/2] veth: veth pair device code cleanup Daniel Lezcano
@ 2008-10-28 21:11 ` Daniel Lezcano
2008-10-29 5:08 ` David Miller
2008-10-28 21:11 ` [patch 2/2] veth: remove unused list Daniel Lezcano
1 sibling, 1 reply; 5+ messages in thread
From: Daniel Lezcano @ 2008-10-28 21:11 UTC (permalink / raw)
To: davem; +Cc: netdev, xemul
[-- Attachment #1: remove-useless-veth-field.patch --]
[-- Type: text/plain, Size: 1013 bytes --]
The veth private structure contains a netdev pointer refering to its peer.
This field is never used and it is pointless because if we can access,
the veth_priv, that means we already have the netdev which is stored
in veth_priv->dev.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
---
drivers/net/veth.c | 3 ---
1 file changed, 3 deletions(-)
Index: net-2.6/drivers/net/veth.c
===================================================================
--- net-2.6.orig/drivers/net/veth.c
+++ net-2.6/drivers/net/veth.c
@@ -30,7 +30,6 @@ struct veth_net_stats {
struct veth_priv {
struct net_device *peer;
- struct net_device *dev;
struct list_head list;
struct veth_net_stats *stats;
unsigned ip_summed;
@@ -420,12 +419,10 @@ static int veth_newlink(struct net_devic
*/
priv = netdev_priv(dev);
- priv->dev = dev;
priv->peer = peer;
list_add(&priv->list, &veth_list);
priv = netdev_priv(peer);
- priv->dev = peer;
priv->peer = dev;
INIT_LIST_HEAD(&priv->list);
return 0;
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* [patch 2/2] veth: remove unused list
2008-10-28 21:11 [patch 0/2] veth: veth pair device code cleanup Daniel Lezcano
2008-10-28 21:11 ` [patch 1/2] veth: Remove useless veth field Daniel Lezcano
@ 2008-10-28 21:11 ` Daniel Lezcano
2008-10-29 5:08 ` David Miller
1 sibling, 1 reply; 5+ messages in thread
From: Daniel Lezcano @ 2008-10-28 21:11 UTC (permalink / raw)
To: davem; +Cc: netdev, xemul
[-- Attachment #1: remove-unused-veth-list.patch --]
[-- Type: text/plain, Size: 1411 bytes --]
The veth network device is stored in a list in the netdev private.
AFAICS, this list is never used so I removed this list from the code.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
---
drivers/net/veth.c | 13 -------------
1 file changed, 13 deletions(-)
Index: net-2.6/drivers/net/veth.c
===================================================================
--- net-2.6.orig/drivers/net/veth.c
+++ net-2.6/drivers/net/veth.c
@@ -8,7 +8,6 @@
*
*/
-#include <linux/list.h>
#include <linux/netdevice.h>
#include <linux/ethtool.h>
#include <linux/etherdevice.h>
@@ -30,13 +29,10 @@ struct veth_net_stats {
struct veth_priv {
struct net_device *peer;
- struct list_head list;
struct veth_net_stats *stats;
unsigned ip_summed;
};
-static LIST_HEAD(veth_list);
-
/*
* ethtool interface
*/
@@ -420,11 +416,9 @@ static int veth_newlink(struct net_devic
priv = netdev_priv(dev);
priv->peer = peer;
- list_add(&priv->list, &veth_list);
priv = netdev_priv(peer);
priv->peer = dev;
- INIT_LIST_HEAD(&priv->list);
return 0;
err_register_dev:
@@ -446,13 +440,6 @@ static void veth_dellink(struct net_devi
priv = netdev_priv(dev);
peer = priv->peer;
- if (!list_empty(&priv->list))
- list_del(&priv->list);
-
- priv = netdev_priv(peer);
- if (!list_empty(&priv->list))
- list_del(&priv->list);
-
unregister_netdevice(dev);
unregister_netdevice(peer);
}
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch 1/2] veth: Remove useless veth field
2008-10-28 21:11 ` [patch 1/2] veth: Remove useless veth field Daniel Lezcano
@ 2008-10-29 5:08 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2008-10-29 5:08 UTC (permalink / raw)
To: dlezcano; +Cc: netdev, xemul
From: Daniel Lezcano <dlezcano@fr.ibm.com>
Date: Tue, 28 Oct 2008 22:11:43 +0100
> The veth private structure contains a netdev pointer refering to its peer.
> This field is never used and it is pointless because if we can access,
> the veth_priv, that means we already have the netdev which is stored
> in veth_priv->dev.
>
> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Applied.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch 2/2] veth: remove unused list
2008-10-28 21:11 ` [patch 2/2] veth: remove unused list Daniel Lezcano
@ 2008-10-29 5:08 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2008-10-29 5:08 UTC (permalink / raw)
To: dlezcano; +Cc: netdev, xemul
From: Daniel Lezcano <dlezcano@fr.ibm.com>
Date: Tue, 28 Oct 2008 22:11:44 +0100
> The veth network device is stored in a list in the netdev private.
> AFAICS, this list is never used so I removed this list from the code.
>
> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Also applied, thanks for these cleanups.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-10-29 5:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-28 21:11 [patch 0/2] veth: veth pair device code cleanup Daniel Lezcano
2008-10-28 21:11 ` [patch 1/2] veth: Remove useless veth field Daniel Lezcano
2008-10-29 5:08 ` David Miller
2008-10-28 21:11 ` [patch 2/2] veth: remove unused list Daniel Lezcano
2008-10-29 5:08 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).