diff options
author | David S. Miller <davem@davemloft.net> | 2010-07-20 02:25:04 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-20 02:25:04 +0400 |
commit | e2df8b7f6665075f7fe93613897117743c7bf0ba (patch) | |
tree | fdab625d9866cfbbde1ca10d1e2dde4201632d5a /drivers/net/ks8842.c | |
parent | d6d9ca0fec6aea0f2e4064474a1c5cdbed873c63 (diff) | |
download | linux-e2df8b7f6665075f7fe93613897117743c7bf0ba.tar.xz |
ks8842: Fix ks8842_tx_frame() for 16bit case.
As reported by Andrew:
drivers/net/ks8842.c: In function 'ks8842_handle_rx':
drivers/net/ks8842.c:428: warning: 'status' may be used uninitialized in this function
Just use the 32-bit status for all reads, and delete the useless
cast to 'int' when reading a u16 into 'len'.
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ks8842.c')
-rw-r--r-- | drivers/net/ks8842.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/ks8842.c b/drivers/net/ks8842.c index ee69dea69be8..634dad1c8b48 100644 --- a/drivers/net/ks8842.c +++ b/drivers/net/ks8842.c @@ -424,16 +424,14 @@ static int ks8842_tx_frame(struct sk_buff *skb, struct net_device *netdev) static void ks8842_rx_frame(struct net_device *netdev, struct ks8842_adapter *adapter) { - u16 status16; u32 status; int len; if (adapter->conf_flags & KS884X_16BIT) { - status16 = ks8842_read16(adapter, 17, REG_QMU_DATA_LO); - len = (int)ks8842_read16(adapter, 17, REG_QMU_DATA_HI); - len &= 0xffff; + status = ks8842_read16(adapter, 17, REG_QMU_DATA_LO); + len = ks8842_read16(adapter, 17, REG_QMU_DATA_HI); netdev_dbg(netdev, "%s - rx_data: status: %x\n", - __func__, status16); + __func__, status); } else { status = ks8842_read32(adapter, 17, REG_QMU_DATA_LO); len = (status >> 16) & 0x7ff; |