diff options
author | Peter Senna Tschudin <peter.senna@gmail.com> | 2014-05-20 10:33:41 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-23 17:17:18 (GMT) |
commit | 8ffca9eae662004016a6d60a2a79ce93f81f150e (patch) | |
tree | 8061e90a714500fb239bc94508d45b125a39410f /drivers/staging/rtl8712/rtl8712_recv.c | |
parent | 8a5e7b012d761e85ed8703412e53d1ef997b43ff (diff) | |
download | linux-8ffca9eae662004016a6d60a2a79ce93f81f150e.tar.xz |
staging: r8712u: Remove useless return variables
This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.
Verified by compilation only.
The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
- return ret;
+ return C;
// </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712/rtl8712_recv.c')
-rw-r--r-- | drivers/staging/rtl8712/rtl8712_recv.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index 0723b2f..667398a 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -123,8 +123,6 @@ void r8712_free_recv_priv(struct recv_priv *precvpriv) int r8712_init_recvbuf(struct _adapter *padapter, struct recv_buf *precvbuf) { - int res = _SUCCESS; - precvbuf->transfer_len = 0; precvbuf->len = 0; precvbuf->ref_cnt = 0; @@ -134,7 +132,7 @@ int r8712_init_recvbuf(struct _adapter *padapter, struct recv_buf *precvbuf) precvbuf->ptail = precvbuf->pbuf; precvbuf->pend = precvbuf->pdata + MAX_RECVBUF_SZ; } - return res; + return _SUCCESS; } int r8712_free_recvframe(union recv_frame *precvframe, @@ -347,7 +345,6 @@ static int amsdu_to_msdu(struct _adapter *padapter, union recv_frame *prframe) _pkt *sub_skb, *subframes[MAX_SUBFRAME_COUNT]; struct recv_priv *precvpriv = &padapter->recvpriv; struct __queue *pfree_recv_queue = &(precvpriv->free_recv_queue); - int ret = _SUCCESS; nr_subframes = 0; pattrib = &prframe->u.hdr.attrib; @@ -435,7 +432,7 @@ static int amsdu_to_msdu(struct _adapter *padapter, union recv_frame *prframe) exit: prframe->u.hdr.len = 0; r8712_free_recvframe(prframe, pfree_recv_queue); - return ret; + return _SUCCESS; } void r8712_rxcmd_event_hdl(struct _adapter *padapter, void *prxcmdbuf) |