Skip to contentSkip to conversation

drivers:net:ifb: Fixed coding style error:assignment in if statement

PATCH In review Sanil Kumar D 2 participants 2 messages Aug 19, 2013 – Aug 21, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers:net:ifb: Fixed coding style error:assignment in if statement

Fixed coding style error (assignment within if statement at 2 places in drivers/net/ifb.c)

---
 drivers/net/ifb.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ifb.c +4 -2
index a3bed28..f3fa85a 100644
@@ -68,7 +68,8 @@ static void ri_tasklet(unsigned long dev)
 	struct sk_buff *skb;
 
 	txq = netdev_get_tx_queue(_dev, 0);
-	if ((skb = skb_peek(&dp->tq)) == NULL) {
+	skb = skb_peek(&dp->tq);
+	if (skb == NULL) {
 		if (__netif_tx_trylock(txq)) {
 			skb_queue_splice_tail_init(&dp->rq, &dp->tq);
 			__netif_tx_unlock(txq);
@@ -112,7 +113,8 @@ static void ri_tasklet(unsigned long dev)
 	}
 
 	if (__netif_tx_trylock(txq)) {
-		if ((skb = skb_peek(&dp->rq)) == NULL) {
+		skb = skb_peek(&dp->rq);
+		if (skb == NULL) {
 			dp->tasklet_pending = 0;
 			if (netif_queue_stopped(_dev))
 				netif_wake_queue(_dev);
Signature · 1 line
1.7.9.5
maintainer
#1 lore raw

From: Sanil Kumar D <[email protected]>
Date: Tue, 20 Aug 2013 05:09:37 +0530

Review

Quoted 1 line
(quoted diff) +1 -0
+	if (skb == NULL) {

"!skb" is preferred.

Review

Quoted 1 line
(quoted diff) +1 -0
+		if (skb == NULL) {

Likewise.