diff options
author | Peter Huewe <peterhuewe@gmx.de> | 2013-02-19 04:18:49 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-11 16:22:43 (GMT) |
commit | cbb0920b9b5090c7006404d8c6533f8ca03cf2ed (patch) | |
tree | 486790197f7e510bc9f2ac13e28daac734c21587 /drivers/staging | |
parent | 81372118c6fc12d41b6e978b915cc010fe6e5700 (diff) | |
download | linux-cbb0920b9b5090c7006404d8c6533f8ca03cf2ed.tar.xz |
staging/slicoss: Remove always true if statement
skbtype is assigned once to NORMAL_ETHFRAME and then checked if it is
NORMAL_ETHFRAME -> remove the checks.
This also gets rid of the (false positive) smatch warning:
slicoss.c:2829 slic_xmit_start() error: potential NULL dereference
'hcmd'.
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/slicoss/slicoss.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c index 753993c..048a341 100644 --- a/drivers/staging/slicoss/slicoss.c +++ b/drivers/staging/slicoss/slicoss.c @@ -2786,7 +2786,6 @@ static netdev_tx_t slic_xmit_start(struct sk_buff *skb, struct net_device *dev) struct adapter *adapter = netdev_priv(dev); struct slic_hostcmd *hcmd = NULL; u32 status = 0; - u32 skbtype = NORMAL_ETHFRAME; void *offloadcmd = NULL; card = adapter->card; @@ -2800,19 +2799,16 @@ static netdev_tx_t slic_xmit_start(struct sk_buff *skb, struct net_device *dev) goto xmit_fail; } - if (skbtype == NORMAL_ETHFRAME) { - hcmd = slic_cmdq_getfree(adapter); - if (!hcmd) { - adapter->xmitq_full = 1; - status = XMIT_FAIL_HOSTCMD_FAIL; - goto xmit_fail; - } - hcmd->skb = skb; - hcmd->busy = 1; - hcmd->type = SLIC_CMD_DUMB; - if (skbtype == NORMAL_ETHFRAME) - slic_xmit_build_request(adapter, hcmd, skb); + hcmd = slic_cmdq_getfree(adapter); + if (!hcmd) { + adapter->xmitq_full = 1; + status = XMIT_FAIL_HOSTCMD_FAIL; + goto xmit_fail; } + hcmd->skb = skb; + hcmd->busy = 1; + hcmd->type = SLIC_CMD_DUMB; + slic_xmit_build_request(adapter, hcmd, skb); dev->stats.tx_packets++; dev->stats.tx_bytes += skb->len; @@ -2838,7 +2834,7 @@ static netdev_tx_t slic_xmit_start(struct sk_buff *skb, struct net_device *dev) xmit_done: return NETDEV_TX_OK; xmit_fail: - slic_xmit_fail(adapter, skb, offloadcmd, skbtype, status); + slic_xmit_fail(adapter, skb, offloadcmd, NORMAL_ETHFRAME, status); goto xmit_done; } |