diff options
| author | Lendacky, Thomas <Thomas.Lendacky@amd.com> | 2014-11-20 12:03:38 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-11-21 15:19:10 -0500 |
| commit | 7bba35bddadbca599aa8be1618e04c548a58d05a (patch) | |
| tree | c15ad45dedc44d12fa6e95b81fb8eff4491b737f /drivers/net/ethernet/amd | |
| parent | 16edd34e9ebb4c0b63c69ada3abe106a309cb431 (diff) | |
amd-xgbe: Incorporate Smatch coding suggestion
The Smatch tool indicated that one of the if statements in xgbe-dev.c
could be rewritten to remove a redundant check for the 'err' variable
in an if statement.
Change the statement as suggested and add a comment to help clarify.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amd')
| -rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-dev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c index dcd0347305c0..72425ffd8d2b 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c | |||
| @@ -1633,7 +1633,8 @@ static int xgbe_dev_read(struct xgbe_channel *channel) | |||
| 1633 | etlt = XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, ETLT); | 1633 | etlt = XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, ETLT); |
| 1634 | DBGPR(" err=%u, etlt=%#x\n", err, etlt); | 1634 | DBGPR(" err=%u, etlt=%#x\n", err, etlt); |
| 1635 | 1635 | ||
| 1636 | if (!err || (err && !etlt)) { | 1636 | if (!err || !etlt) { |
| 1637 | /* No error if err is 0 or etlt is 0 */ | ||
| 1637 | if ((etlt == 0x09) && | 1638 | if ((etlt == 0x09) && |
| 1638 | (netdev->features & NETIF_F_HW_VLAN_CTAG_RX)) { | 1639 | (netdev->features & NETIF_F_HW_VLAN_CTAG_RX)) { |
| 1639 | XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, | 1640 | XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, |
