netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Decotigny <decot@google.com>
To: Jay Vosburgh <fubar@us.ibm.com>,
	Andy Gospodarek <andy@greyhouse.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: David Decotigny <decot@google.com>
Subject: [PATCH 2/3] net-bonding: Fix minor/cosmetic type inconsistencies
Date: Wed, 13 Apr 2011 18:22:30 -0700	[thread overview]
Message-ID: <1302744151-12452-2-git-send-email-decot@google.com> (raw)
In-Reply-To: <1302744151-12452-1-git-send-email-decot@google.com>

The __get_link_speed() function returns a u16 value which was stored
in a u32 local variable. This patch uses the return value directly,
thus fixing that minor type consistency.

The 'duplex' field in struct slave being encoded on 8 bits, to be more
consistent we use a u8 integer (instead of u16) whenever we copy it to
local variables.

Signed-off-by: David Decotigny <decot@google.com>
---
 drivers/net/bonding/bond_3ad.c  |    4 +---
 drivers/net/bonding/bond_main.c |    2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 494bf96..123dd60 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -716,11 +716,9 @@ static void __set_agg_ports_ready(struct aggregator *aggregator, int val)
 static u32 __get_agg_bandwidth(struct aggregator *aggregator)
 {
 	u32 bandwidth = 0;
-	u32 basic_speed;
 
 	if (aggregator->num_of_ports) {
-		basic_speed = __get_link_speed(aggregator->lag_ports);
-		switch (basic_speed) {
+		switch (__get_link_speed(aggregator->lag_ports)) {
 		case AD_LINK_SPEED_BITMASK_1MBPS:
 			bandwidth = aggregator->num_of_ports;
 			break;
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 8264ed7..145f9be 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3340,7 +3340,7 @@ static int bond_slave_netdev_event(unsigned long event,
 			slave = bond_get_slave_by_dev(bond, slave_dev);
 			if (slave) {
 				u16 old_speed = slave->speed;
-				u16 old_duplex = slave->duplex;
+				u8  old_duplex = slave->duplex;
 
 				bond_update_speed_duplex(slave);
 
-- 
1.7.3.1

  reply	other threads:[~2011-04-14  1:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-14  1:22 [PATCH 1/3] net-bonding: Fix minor sparse complaints David Decotigny
2011-04-14  1:22 ` David Decotigny [this message]
2011-04-15  5:04   ` [PATCH 2/3] net-bonding: Fix minor/cosmetic type inconsistencies David Miller
2011-04-14  1:22 ` [PATCH 3/3] net-bonding: Adding support for throughputs larger than 65536 Mbps David Decotigny
2011-04-15  5:04   ` David Miller
2011-04-15  5:03 ` [PATCH 1/3] net-bonding: Fix minor sparse complaints 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=1302744151-12452-2-git-send-email-decot@google.com \
    --to=decot@google.com \
    --cc=andy@greyhouse.net \
    --cc=fubar@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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 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).