From: raj@tardy.cup.hp.com (Rick Jones)
To: <netdev@vger.kernel.org>
Cc: <fubar@us.ibm.com>
Subject: [PATCH net-next] bonding: bond_update_speed_duplex() can return void since no callers check its return
Date: Thu, 26 Apr 2012 14:20:30 -0700 (PDT) [thread overview]
Message-ID: <20120426212030.269072900341@tardy> (raw)
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;
}
/*
next reply other threads:[~2012-04-26 21:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-26 21:20 Rick Jones [this message]
2012-04-27 4:04 ` [PATCH net-next] bonding: bond_update_speed_duplex() can return void since no callers check its return David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120426212030.269072900341@tardy \
--to=raj@tardy.cup.hp.com \
--cc=fubar@us.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=rick.jones2@hp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.