All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] bonding: bond_update_speed_duplex() can return void since no callers check its return
@ 2012-04-26 21:20 Rick Jones
  2012-04-27  4:04 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Rick Jones @ 2012-04-26 21:20 UTC (permalink / raw)
  To: netdev; +Cc: fubar

From: Rick Jones <rick.jones2@hp.com>

As none of the callers of bond_update_speed_duplex (need to) check its
return value, there is little point in it returning anything.

Signed-off-by: Rick Jones <rick.jones2@hp.com>
---

Compile tested only

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 44e6a64..16dbf53 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -549,9 +549,9 @@ down:
  * Get link speed and duplex from the slave's base driver
  * using ethtool. If for some reason the call fails or the
  * values are invalid, set speed and duplex to -1,
- * and return error.
+ * and return.
  */
-static int bond_update_speed_duplex(struct slave *slave)
+static void bond_update_speed_duplex(struct slave *slave)
 {
 	struct net_device *slave_dev = slave->dev;
 	struct ethtool_cmd ecmd;
@@ -563,24 +563,24 @@ static int bond_update_speed_duplex(struct slave *slave)
 
 	res = __ethtool_get_settings(slave_dev, &ecmd);
 	if (res < 0)
-		return -1;
+		return;
 
 	slave_speed = ethtool_cmd_speed(&ecmd);
 	if (slave_speed == 0 || slave_speed == ((__u32) -1))
-		return -1;
+		return;
 
 	switch (ecmd.duplex) {
 	case DUPLEX_FULL:
 	case DUPLEX_HALF:
 		break;
 	default:
-		return -1;
+		return;
 	}
 
 	slave->speed = slave_speed;
 	slave->duplex = ecmd.duplex;
 
-	return 0;
+	return;
 }
 
 /*

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

* Re: [PATCH net-next] bonding: bond_update_speed_duplex() can return void since no callers check its return
  2012-04-26 21:20 [PATCH net-next] bonding: bond_update_speed_duplex() can return void since no callers check its return Rick Jones
@ 2012-04-27  4:04 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-04-27  4:04 UTC (permalink / raw)
  To: rick.jones2, raj; +Cc: netdev, fubar

From: raj@tardy.cup.hp.com (Rick Jones)
Date: Thu, 26 Apr 2012 14:20:30 -0700 (PDT)

> From: Rick Jones <rick.jones2@hp.com>
> 
> As none of the callers of bond_update_speed_duplex (need to) check its
> return value, there is little point in it returning anything.
> 
> Signed-off-by: Rick Jones <rick.jones2@hp.com>

Applied.

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

end of thread, other threads:[~2012-04-27  4:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-26 21:20 [PATCH net-next] bonding: bond_update_speed_duplex() can return void since no callers check its return Rick Jones
2012-04-27  4:04 ` David Miller

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.