netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] bonding: remove the redundant judgements for bonding
@ 2014-02-12  6:58 Ding Tianhong
  2014-02-12  6:58 ` [PATCH net-next 1/2] bonding: remove the redundant judgements for bond_set_mac_address() Ding Tianhong
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ding Tianhong @ 2014-02-12  6:58 UTC (permalink / raw)
  To: fubar, vfalico, andy; +Cc: davem, netdev

Remove the redundant judgements for bond_set_mac_address() and
bond_option_queue_id_set().

Ding Tianhong (2):
  bonding: remove the redundant judgements for bond_set_mac_address()
  bonding: remove the redundant judgements for
    bond_option_queue_id_set()

 drivers/net/bonding/bond_main.c    | 8 --------
 drivers/net/bonding/bond_options.c | 3 +--
 2 files changed, 1 insertion(+), 10 deletions(-)

-- 
1.8.0

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

* [PATCH net-next 1/2] bonding: remove the redundant judgements for bond_set_mac_address()
  2014-02-12  6:58 [PATCH net-next 0/2] bonding: remove the redundant judgements for bonding Ding Tianhong
@ 2014-02-12  6:58 ` Ding Tianhong
  2014-02-13 14:29   ` Jiri Pirko
  2014-02-12  6:58 ` [PATCH net-next 2/2] bonding: remove the redundant judgements for bond_option_queue_id_set() Ding Tianhong
  2014-02-13 22:49 ` [PATCH net-next 0/2] bonding: remove the redundant judgements for bonding David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Ding Tianhong @ 2014-02-12  6:58 UTC (permalink / raw)
  To: fubar, vfalico, andy; +Cc: davem, netdev

The dev_set_mac_address() will check the dev->netdev_ops->ndo_set_mac_address,
so no need to check it in bond_set_mac_address().

Cc: Jay Vosburgh <fubar@us.ibm.com>
Cc: Veaceslav Falico <vfalico@redhat.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
 drivers/net/bonding/bond_main.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 71ba18e..58aa531 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3461,15 +3461,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
 	 */
 
 	bond_for_each_slave(bond, slave, iter) {
-		const struct net_device_ops *slave_ops = slave->dev->netdev_ops;
 		pr_debug("slave %p %s\n", slave, slave->dev->name);
-
-		if (slave_ops->ndo_set_mac_address == NULL) {
-			res = -EOPNOTSUPP;
-			pr_debug("EOPNOTSUPP %s\n", slave->dev->name);
-			goto unwind;
-		}
-
 		res = dev_set_mac_address(slave->dev, addr);
 		if (res) {
 			/* TODO: consider downing the slave
-- 
1.8.0

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

* [PATCH net-next 2/2] bonding: remove the redundant judgements for bond_option_queue_id_set()
  2014-02-12  6:58 [PATCH net-next 0/2] bonding: remove the redundant judgements for bonding Ding Tianhong
  2014-02-12  6:58 ` [PATCH net-next 1/2] bonding: remove the redundant judgements for bond_set_mac_address() Ding Tianhong
@ 2014-02-12  6:58 ` Ding Tianhong
  2014-02-13 14:30   ` Jiri Pirko
  2014-02-13 22:49 ` [PATCH net-next 0/2] bonding: remove the redundant judgements for bonding David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Ding Tianhong @ 2014-02-12  6:58 UTC (permalink / raw)
  To: fubar, vfalico, andy; +Cc: davem, netdev

The dev_valid_name() will check the buffer length for input name, no need to
check it twice.

Cc: Jay Vosburgh <fubar@us.ibm.com>
Cc: Veaceslav Falico <vfalico@redhat.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
 drivers/net/bonding/bond_options.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index 11cb943..832d6e9 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -1199,8 +1199,7 @@ int bond_option_queue_id_set(struct bonding *bond,
 		goto err_no_cmd;
 
 	/* Check buffer length, valid ifname and queue id */
-	if (strlen(newval->string) > IFNAMSIZ ||
-	    !dev_valid_name(newval->string) ||
+	if (!dev_valid_name(newval->string) ||
 	    qid > bond->dev->real_num_tx_queues)
 		goto err_no_cmd;
 
-- 
1.8.0

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

* Re: [PATCH net-next 1/2] bonding: remove the redundant judgements for bond_set_mac_address()
  2014-02-12  6:58 ` [PATCH net-next 1/2] bonding: remove the redundant judgements for bond_set_mac_address() Ding Tianhong
@ 2014-02-13 14:29   ` Jiri Pirko
  0 siblings, 0 replies; 6+ messages in thread
From: Jiri Pirko @ 2014-02-13 14:29 UTC (permalink / raw)
  To: Ding Tianhong; +Cc: fubar, vfalico, andy, davem, netdev

Wed, Feb 12, 2014 at 07:58:49AM CET, dingtianhong@huawei.com wrote:
>The dev_set_mac_address() will check the dev->netdev_ops->ndo_set_mac_address,
>so no need to check it in bond_set_mac_address().
>
>Cc: Jay Vosburgh <fubar@us.ibm.com>
>Cc: Veaceslav Falico <vfalico@redhat.com>
>Cc: Andy Gospodarek <andy@greyhouse.net>
>Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>

Reviewed-by: Jiri Pirko <jiri@resnulli.us>

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

* Re: [PATCH net-next 2/2] bonding: remove the redundant judgements for bond_option_queue_id_set()
  2014-02-12  6:58 ` [PATCH net-next 2/2] bonding: remove the redundant judgements for bond_option_queue_id_set() Ding Tianhong
@ 2014-02-13 14:30   ` Jiri Pirko
  0 siblings, 0 replies; 6+ messages in thread
From: Jiri Pirko @ 2014-02-13 14:30 UTC (permalink / raw)
  To: Ding Tianhong; +Cc: fubar, vfalico, andy, davem, netdev

Wed, Feb 12, 2014 at 07:58:50AM CET, dingtianhong@huawei.com wrote:
>The dev_valid_name() will check the buffer length for input name, no need to
>check it twice.
>
>Cc: Jay Vosburgh <fubar@us.ibm.com>
>Cc: Veaceslav Falico <vfalico@redhat.com>
>Cc: Andy Gospodarek <andy@greyhouse.net>
>Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>

Reviewed-by: Jiri Pirko <jiri@resnulli.us>

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

* Re: [PATCH net-next 0/2] bonding: remove the redundant judgements for bonding
  2014-02-12  6:58 [PATCH net-next 0/2] bonding: remove the redundant judgements for bonding Ding Tianhong
  2014-02-12  6:58 ` [PATCH net-next 1/2] bonding: remove the redundant judgements for bond_set_mac_address() Ding Tianhong
  2014-02-12  6:58 ` [PATCH net-next 2/2] bonding: remove the redundant judgements for bond_option_queue_id_set() Ding Tianhong
@ 2014-02-13 22:49 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2014-02-13 22:49 UTC (permalink / raw)
  To: dingtianhong; +Cc: fubar, vfalico, andy, netdev

From: Ding Tianhong <dingtianhong@huawei.com>
Date: Wed, 12 Feb 2014 14:58:48 +0800

> Remove the redundant judgements for bond_set_mac_address() and
> bond_option_queue_id_set().

Series applied, thanks.

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

end of thread, other threads:[~2014-02-13 22:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-12  6:58 [PATCH net-next 0/2] bonding: remove the redundant judgements for bonding Ding Tianhong
2014-02-12  6:58 ` [PATCH net-next 1/2] bonding: remove the redundant judgements for bond_set_mac_address() Ding Tianhong
2014-02-13 14:29   ` Jiri Pirko
2014-02-12  6:58 ` [PATCH net-next 2/2] bonding: remove the redundant judgements for bond_option_queue_id_set() Ding Tianhong
2014-02-13 14:30   ` Jiri Pirko
2014-02-13 22:49 ` [PATCH net-next 0/2] bonding: remove the redundant judgements for bonding 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).