netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/3 RESEND] bonding: slight optimization and cleanup
@ 2014-05-07 14:10 Ding Tianhong
  2014-05-07 14:10 ` [PATCH net-next v2 1/3 RESEND] bonding: remove the unnecessary struct bond_net Ding Tianhong
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ding Tianhong @ 2014-05-07 14:10 UTC (permalink / raw)
  To: fubar, vfalico, andy; +Cc: davem, netdev

v1->v2: fix some wrong format for patch 1.

Ding Tianhong (3):
  bonding: remove the unnecessary struct bond_net
  bonding: simplify the slave_do_arp_validate_only()
  bonding: remove the unused macro

 drivers/net/bonding/bond_main.c |  4 ++--
 drivers/net/bonding/bonding.h   | 23 +++++++++--------------
 2 files changed, 11 insertions(+), 16 deletions(-)

-- 
1.8.0

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

* [PATCH net-next v2 1/3 RESEND] bonding: remove the unnecessary struct bond_net
  2014-05-07 14:10 [PATCH net-next v2 0/3 RESEND] bonding: slight optimization and cleanup Ding Tianhong
@ 2014-05-07 14:10 ` Ding Tianhong
  2014-05-07 14:10 ` [PATCH net-next v2 2/3 RESEND] bonding: simplify the slave_do_arp_validate_only() Ding Tianhong
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Ding Tianhong @ 2014-05-07 14:10 UTC (permalink / raw)
  To: fubar, vfalico, andy; +Cc: davem, netdev

Move the structure bond_net forward, and remove the unnecessary structure declaration.

Cc: Jay Vosburgh <j.vosburgh@gmail.com>
Cc: Veaceslav Falico <vfalico@gmail.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
 drivers/net/bonding/bonding.h | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index b8bdd0a..9f23bf3 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -487,7 +487,14 @@ static inline bool slave_can_tx(struct slave *slave)
 		return false;
 }
 
-struct bond_net;
+struct bond_net {
+	struct net		*net;	/* Associated network namespace */
+	struct list_head	dev_list;
+#ifdef CONFIG_PROC_FS
+	struct proc_dir_entry	*proc_dir;
+#endif
+	struct class_attribute	class_attr_bonding_masters;
+};
 
 int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, struct slave *slave);
 void bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev);
@@ -516,15 +523,6 @@ struct net_device *bond_option_active_slave_get_rcu(struct bonding *bond);
 struct net_device *bond_option_active_slave_get(struct bonding *bond);
 const char *bond_slave_link_status(s8 link);
 
-struct bond_net {
-	struct net *		net;	/* Associated network namespace */
-	struct list_head	dev_list;
-#ifdef CONFIG_PROC_FS
-	struct proc_dir_entry *	proc_dir;
-#endif
-	struct class_attribute	class_attr_bonding_masters;
-};
-
 #ifdef CONFIG_PROC_FS
 void bond_create_proc_entry(struct bonding *bond);
 void bond_remove_proc_entry(struct bonding *bond);
-- 
1.8.0

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

* [PATCH net-next v2 2/3 RESEND] bonding: simplify the slave_do_arp_validate_only()
  2014-05-07 14:10 [PATCH net-next v2 0/3 RESEND] bonding: slight optimization and cleanup Ding Tianhong
  2014-05-07 14:10 ` [PATCH net-next v2 1/3 RESEND] bonding: remove the unnecessary struct bond_net Ding Tianhong
@ 2014-05-07 14:10 ` Ding Tianhong
  2014-05-07 14:10 ` [PATCH net-next v2 3/3 RESEND] bonding: remove the unused macro Ding Tianhong
  2014-05-09  3:41 ` [PATCH net-next v2 0/3 RESEND] bonding: slight optimization and cleanup David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Ding Tianhong @ 2014-05-07 14:10 UTC (permalink / raw)
  To: fubar, vfalico, andy; +Cc: davem, netdev

The argument slave is not used for slave_do_arp_validate_only(), so no need
to keep it, make the function more simple.

Cc: Jay Vosburgh <j.vosburgh@gmail.com>
Cc: Veaceslav Falico <vfalico@gmail.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
 drivers/net/bonding/bond_main.c | 4 ++--
 drivers/net/bonding/bonding.h   | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 69aff72..ff73c14 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2291,8 +2291,8 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
 	int alen, is_arp = skb->protocol == __cpu_to_be16(ETH_P_ARP);
 
 	if (!slave_do_arp_validate(bond, slave)) {
-		if ((slave_do_arp_validate_only(bond, slave) && is_arp) ||
-		    !slave_do_arp_validate_only(bond, slave))
+		if ((slave_do_arp_validate_only(bond) && is_arp) ||
+		    !slave_do_arp_validate_only(bond))
 			slave->last_rx = jiffies;
 		return RX_HANDLER_ANOTHER;
 	} else if (!is_arp) {
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 9f23bf3..5d1e1a8 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -395,8 +395,7 @@ static inline int slave_do_arp_validate(struct bonding *bond,
 	return bond->params.arp_validate & (1 << bond_slave_state(slave));
 }
 
-static inline int slave_do_arp_validate_only(struct bonding *bond,
-					     struct slave *slave)
+static inline int slave_do_arp_validate_only(struct bonding *bond)
 {
 	return bond->params.arp_validate & BOND_ARP_FILTER;
 }
-- 
1.8.0

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

* [PATCH net-next v2 3/3 RESEND] bonding: remove the unused macro
  2014-05-07 14:10 [PATCH net-next v2 0/3 RESEND] bonding: slight optimization and cleanup Ding Tianhong
  2014-05-07 14:10 ` [PATCH net-next v2 1/3 RESEND] bonding: remove the unnecessary struct bond_net Ding Tianhong
  2014-05-07 14:10 ` [PATCH net-next v2 2/3 RESEND] bonding: simplify the slave_do_arp_validate_only() Ding Tianhong
@ 2014-05-07 14:10 ` Ding Tianhong
  2014-05-09  3:41 ` [PATCH net-next v2 0/3 RESEND] bonding: slight optimization and cleanup David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Ding Tianhong @ 2014-05-07 14:10 UTC (permalink / raw)
  To: fubar, vfalico, andy; +Cc: davem, netdev

Cc: Jay Vosburgh <j.vosburgh@gmail.com>
Cc: Veaceslav Falico <vfalico@gmail.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
 drivers/net/bonding/bonding.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 5d1e1a8..f462f6f 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -182,8 +182,6 @@ struct bond_parm_tbl {
 	int mode;
 };
 
-#define BOND_MAX_MODENAME_LEN 20
-
 struct slave {
 	struct net_device *dev; /* first - useful for panic debug */
 	struct bonding *bond; /* our master */
-- 
1.8.0

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

* Re: [PATCH net-next v2 0/3 RESEND] bonding: slight optimization and cleanup
  2014-05-07 14:10 [PATCH net-next v2 0/3 RESEND] bonding: slight optimization and cleanup Ding Tianhong
                   ` (2 preceding siblings ...)
  2014-05-07 14:10 ` [PATCH net-next v2 3/3 RESEND] bonding: remove the unused macro Ding Tianhong
@ 2014-05-09  3:41 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2014-05-09  3:41 UTC (permalink / raw)
  To: dingtianhong; +Cc: fubar, vfalico, andy, netdev

From: Ding Tianhong <dingtianhong@huawei.com>
Date: Wed, 7 May 2014 22:10:18 +0800

> v1->v2: fix some wrong format for patch 1.
> 
> Ding Tianhong (3):
>   bonding: remove the unnecessary struct bond_net
>   bonding: simplify the slave_do_arp_validate_only()
>   bonding: remove the unused macro

Series applied, thanks.

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

end of thread, other threads:[~2014-05-09  3:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-07 14:10 [PATCH net-next v2 0/3 RESEND] bonding: slight optimization and cleanup Ding Tianhong
2014-05-07 14:10 ` [PATCH net-next v2 1/3 RESEND] bonding: remove the unnecessary struct bond_net Ding Tianhong
2014-05-07 14:10 ` [PATCH net-next v2 2/3 RESEND] bonding: simplify the slave_do_arp_validate_only() Ding Tianhong
2014-05-07 14:10 ` [PATCH net-next v2 3/3 RESEND] bonding: remove the unused macro Ding Tianhong
2014-05-09  3:41 ` [PATCH net-next v2 0/3 RESEND] bonding: slight optimization and cleanup 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).