Skip to contentSkip to conversation

caif_dev: use true and false for boolean values

PATCH In review Gustavo A. R. Silva 1 participant 2 messages Mar 5, 2018 – Mar 22, 2018

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

PATCH 1/1 caif_dev: use true and false for boolean values

Assign true or false to boolean variables instead of an integer value.

This issue was detected with the help of Coccinelle.

---
 net/caif/caif_dev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
net/caif/caif_dev.c +4 -4
index e0adcd1..f2848d6 100644
@@ -139,7 +139,7 @@ static void caif_flow_cb(struct sk_buff *skb)
 
 	spin_lock_bh(&caifd->flow_lock);
 	send_xoff = caifd->xoff;
-	caifd->xoff = 0;
+	caifd->xoff = false;
 	dtor = caifd->xoff_skb_dtor;
 
 	if (WARN_ON(caifd->xoff_skb != skb))
@@ -213,7 +213,7 @@ static int transmit(struct cflayer *layer, struct cfpkt *pkt)
 	pr_debug("queue has stopped(%d) or is full (%d > %d)\n",
 			netif_queue_stopped(caifd->netdev),
 			qlen, high);
-	caifd->xoff = 1;
+	caifd->xoff = true;
 	caifd->xoff_skb = skb;
 	caifd->xoff_skb_dtor = skb->destructor;
 	skb->destructor = caif_flow_cb;
@@ -400,7 +400,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
 			break;
 		}
 
-		caifd->xoff = 0;
+		caifd->xoff = false;
 		cfcnfg_set_phy_state(cfg, &caifd->layer, true);
 		rcu_read_unlock();
 
@@ -435,7 +435,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
 		if (caifd->xoff_skb_dtor != NULL && caifd->xoff_skb != NULL)
 			caifd->xoff_skb->destructor = caifd->xoff_skb_dtor;
 
-		caifd->xoff = 0;
+		caifd->xoff = false;
 		caifd->xoff_skb_dtor = NULL;
 		caifd->xoff_skb = NULL;
 
Signature · 1 line
2.7.4
#1 lore raw

Hi all,

I was just wondering about the status of this patch.

Thanks!
--
Gustavo

Quoted 50 lines · Gustavo A. R. Silva

Assign true or false to boolean variables instead of an integer value.

This issue was detected with the help of Coccinelle.

---
  net/caif/caif_dev.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
net/caif/caif_dev.c +4 -4
index e0adcd1..f2848d6 100644
@@ -139,7 +139,7 @@ static void caif_flow_cb(struct sk_buff *skb)
 
  	spin_lock_bh(&caifd->flow_lock);
  	send_xoff = caifd->xoff;
-	caifd->xoff = 0;
+	caifd->xoff = false;
  	dtor = caifd->xoff_skb_dtor;
 
  	if (WARN_ON(caifd->xoff_skb != skb))
@@ -213,7 +213,7 @@ static int transmit(struct cflayer *layer, struct cfpkt *pkt)
  	pr_debug("queue has stopped(%d) or is full (%d > %d)\n",
  			netif_queue_stopped(caifd->netdev),
  			qlen, high);
-	caifd->xoff = 1;
+	caifd->xoff = true;
  	caifd->xoff_skb = skb;
  	caifd->xoff_skb_dtor = skb->destructor;
  	skb->destructor = caif_flow_cb;
@@ -400,7 +400,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
  			break;
  		}
 
-		caifd->xoff = 0;
+		caifd->xoff = false;
  		cfcnfg_set_phy_state(cfg, &caifd->layer, true);
  		rcu_read_unlock();
 
@@ -435,7 +435,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
  		if (caifd->xoff_skb_dtor != NULL && caifd->xoff_skb != NULL)
  			caifd->xoff_skb->destructor = caifd->xoff_skb_dtor;
 
-		caifd->xoff = 0;
+		caifd->xoff = false;
  		caifd->xoff_skb_dtor = NULL;
  		caifd->xoff_skb = NULL;