staging: rtl8712: Place constants on the right side of '!'
PATCH v2 2/3 staging: rtl8712: Place constants on the right side of '!'
Move constants to the right of binary operator '!'. This issue was identified using the Coccinelle script:
@@
constant c,c1;
expression e,e1,e2;
local idexpression i;
binary operator b = {==,!=,&,|};
@@
(
c b (c1)
|
i b e1
|
c | e1 | e2 | ...
|
c | (e ? e1 : e2)
|
- c
+ e
b
- e
+ c
)
---
Changes in v2:
-change subject line
-inserted Coccinelle script
drivers/staging/rtl8712/rtl8712_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/rtl8712_recv.c +1 -1
@@ -1109,7 +1109,7 @@ static void recv_tasklet(void *priv)struct _adapter *padapter = (struct _adapter *)priv;struct recv_priv *precvpriv = &padapter->recvpriv; -while (NULL != (pskb =skb_dequeue (&precvpriv->rx_skb_queue))) { +while ((pskb =skb_dequeue (&precvpriv->rx_skb_queue)) !=NULL ) {recvbuf2recvframe (padapter, pskb);skb_reset_tail_pointer (pskb); pskb->len =0 ;
--
2.1.4
Greg KH
maintainerQuoted 38 lines · Bhaktipriya Shridhar
Move constants to the right of binary operator '!'. This issue was identified using the Coccinelle script:
@@
constant c,c1;
expression e,e1,e2;
local idexpression i;
binary operator b = {==,!=,&,|};
@@(
c b (c1)
|
i b e1
|
c | e1 | e2 | ...
|
c | (e ? e1 : e2)
|
- c
+ e
b
- e
+ c
)Signed-off-by Bhaktipriya Shridhar <[email protected]>---
Changes in v2:
-change subject line
-inserted Coccinelle scriptdrivers/staging/rtl8712/rtl8712_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/rtl8712/rtl8712_recv.c +0
-0
drivers/staging/rtl8712/rtl8712_recv.c static void recv_tasklet(void *priv) · line 1112
Quoted 5 lines
drivers/staging/rtl8712/rtl8712_recv.c +1
-1@@ -1109,7 +1109,7 @@ static void recv_tasklet(void *priv)struct _adapter *padapter = (struct _adapter *)priv;struct recv_priv *precvpriv = &padapter->recvpriv; -while (NULL != (pskb =skb_dequeue (&precvpriv->rx_skb_queue))) { +while ((pskb =skb_dequeue (&precvpriv->rx_skb_queue)) !=NULL ) {
Please break the assignment out of the while() statement to make this more readable and understandable.