diff options
author | Bhaktipriya Shridhar <bhaktipriya96@gmail.com> | 2016-02-25 13:47:33 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-12 09:09:09 +0300 |
commit | 40430f0ce24111cf616a51c704ecb371858e2028 (patch) | |
tree | 36e6717b978311c6a3e8598847b499b3f3f3cd93 /drivers/staging/rtl8712 | |
parent | 9155c92463ecbb55c6eca6145e139869e9ba1546 (diff) | |
download | linux-40430f0ce24111cf616a51c704ecb371858e2028.tar.xz |
staging: rtl8712: Make return of 0 explicit
Delete unnecessary local variable whose value is always 0 and
return 0 as the result.
The following Coccinelle script was used:
@@
identifier ret; expression E;
type T;
@@
(
- T ret;
|
- T ret = 0;
)
... when != \(ret=E
\|ret--\|ret++\|--ret\|++ret\|ret-=E\|ret+=E\|ret|=E\|ret&=E\)
(
?-ret = 0;
)
... when != \(ret=E
\|ret--\|ret++\|--ret\|++ret\|ret-=E\|ret+=E\|ret|=E\|ret&=E\)
(
return
- ret
+ 0
;
)
Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712')
-rw-r--r-- | drivers/staging/rtl8712/xmit_linux.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/staging/rtl8712/xmit_linux.c b/drivers/staging/rtl8712/xmit_linux.c index f708d95e8872..695f9b9fc749 100644 --- a/drivers/staging/rtl8712/xmit_linux.c +++ b/drivers/staging/rtl8712/xmit_linux.c @@ -161,19 +161,15 @@ int r8712_xmit_entry(_pkt *pkt, struct net_device *pnetdev) struct xmit_frame *pxmitframe = NULL; struct _adapter *padapter = netdev_priv(pnetdev); struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); - int ret = 0; if (!r8712_if_up(padapter)) { - ret = 0; goto _xmit_entry_drop; } pxmitframe = r8712_alloc_xmitframe(pxmitpriv); if (!pxmitframe) { - ret = 0; goto _xmit_entry_drop; } if ((!r8712_update_attrib(padapter, pkt, &pxmitframe->attrib))) { - ret = 0; goto _xmit_entry_drop; } padapter->ledpriv.LedControlHandler(padapter, LED_CTL_TX); @@ -185,11 +181,11 @@ int r8712_xmit_entry(_pkt *pkt, struct net_device *pnetdev) } pxmitpriv->tx_pkts++; pxmitpriv->tx_bytes += pxmitframe->attrib.last_txcmdsz; - return ret; + return 0; _xmit_entry_drop: if (pxmitframe) r8712_free_xmitframe(pxmitpriv, pxmitframe); pxmitpriv->tx_drop++; dev_kfree_skb_any(pkt); - return ret; + return 0; } |