Commit 941247f9 authored by Peter Senna Tschudin's avatar Peter Senna Tschudin Committed by Gustavo Padovan

Bluetooth: Fix assignment of 0/1 to bool variables

Convert 0 to false and 1 to true when assigning values to bool
variables. Inspired by commit 3db1cd5c.

The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):

@@
bool b;
@@
(
-b = 0
+b = false
|
-b = 1
+b = true
)
Signed-off-by: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
parent d62e6d67
...@@ -5797,7 +5797,7 @@ static int l2cap_rx_state_recv(struct l2cap_chan *chan, ...@@ -5797,7 +5797,7 @@ static int l2cap_rx_state_recv(struct l2cap_chan *chan,
struct sk_buff *skb, u8 event) struct sk_buff *skb, u8 event)
{ {
int err = 0; int err = 0;
bool skb_in_use = 0; bool skb_in_use = false;
BT_DBG("chan %p, control %p, skb %p, event %d", chan, control, skb, BT_DBG("chan %p, control %p, skb %p, event %d", chan, control, skb,
event); event);
...@@ -5818,7 +5818,7 @@ static int l2cap_rx_state_recv(struct l2cap_chan *chan, ...@@ -5818,7 +5818,7 @@ static int l2cap_rx_state_recv(struct l2cap_chan *chan,
control->txseq); control->txseq);
chan->buffer_seq = chan->expected_tx_seq; chan->buffer_seq = chan->expected_tx_seq;
skb_in_use = 1; skb_in_use = true;
err = l2cap_reassemble_sdu(chan, skb, control); err = l2cap_reassemble_sdu(chan, skb, control);
if (err) if (err)
...@@ -5854,7 +5854,7 @@ static int l2cap_rx_state_recv(struct l2cap_chan *chan, ...@@ -5854,7 +5854,7 @@ static int l2cap_rx_state_recv(struct l2cap_chan *chan,
* current frame is stored for later use. * current frame is stored for later use.
*/ */
skb_queue_tail(&chan->srej_q, skb); skb_queue_tail(&chan->srej_q, skb);
skb_in_use = 1; skb_in_use = true;
BT_DBG("Queued %p (queue len %d)", skb, BT_DBG("Queued %p (queue len %d)", skb,
skb_queue_len(&chan->srej_q)); skb_queue_len(&chan->srej_q));
...@@ -5932,7 +5932,7 @@ static int l2cap_rx_state_srej_sent(struct l2cap_chan *chan, ...@@ -5932,7 +5932,7 @@ static int l2cap_rx_state_srej_sent(struct l2cap_chan *chan,
{ {
int err = 0; int err = 0;
u16 txseq = control->txseq; u16 txseq = control->txseq;
bool skb_in_use = 0; bool skb_in_use = false;
BT_DBG("chan %p, control %p, skb %p, event %d", chan, control, skb, BT_DBG("chan %p, control %p, skb %p, event %d", chan, control, skb,
event); event);
...@@ -5944,7 +5944,7 @@ static int l2cap_rx_state_srej_sent(struct l2cap_chan *chan, ...@@ -5944,7 +5944,7 @@ static int l2cap_rx_state_srej_sent(struct l2cap_chan *chan,
/* Keep frame for reassembly later */ /* Keep frame for reassembly later */
l2cap_pass_to_tx(chan, control); l2cap_pass_to_tx(chan, control);
skb_queue_tail(&chan->srej_q, skb); skb_queue_tail(&chan->srej_q, skb);
skb_in_use = 1; skb_in_use = true;
BT_DBG("Queued %p (queue len %d)", skb, BT_DBG("Queued %p (queue len %d)", skb,
skb_queue_len(&chan->srej_q)); skb_queue_len(&chan->srej_q));
...@@ -5955,7 +5955,7 @@ static int l2cap_rx_state_srej_sent(struct l2cap_chan *chan, ...@@ -5955,7 +5955,7 @@ static int l2cap_rx_state_srej_sent(struct l2cap_chan *chan,
l2cap_pass_to_tx(chan, control); l2cap_pass_to_tx(chan, control);
skb_queue_tail(&chan->srej_q, skb); skb_queue_tail(&chan->srej_q, skb);
skb_in_use = 1; skb_in_use = true;
BT_DBG("Queued %p (queue len %d)", skb, BT_DBG("Queued %p (queue len %d)", skb,
skb_queue_len(&chan->srej_q)); skb_queue_len(&chan->srej_q));
...@@ -5970,7 +5970,7 @@ static int l2cap_rx_state_srej_sent(struct l2cap_chan *chan, ...@@ -5970,7 +5970,7 @@ static int l2cap_rx_state_srej_sent(struct l2cap_chan *chan,
* the missing frames. * the missing frames.
*/ */
skb_queue_tail(&chan->srej_q, skb); skb_queue_tail(&chan->srej_q, skb);
skb_in_use = 1; skb_in_use = true;
BT_DBG("Queued %p (queue len %d)", skb, BT_DBG("Queued %p (queue len %d)", skb,
skb_queue_len(&chan->srej_q)); skb_queue_len(&chan->srej_q));
...@@ -5984,7 +5984,7 @@ static int l2cap_rx_state_srej_sent(struct l2cap_chan *chan, ...@@ -5984,7 +5984,7 @@ static int l2cap_rx_state_srej_sent(struct l2cap_chan *chan,
* SREJ'd frames. * SREJ'd frames.
*/ */
skb_queue_tail(&chan->srej_q, skb); skb_queue_tail(&chan->srej_q, skb);
skb_in_use = 1; skb_in_use = true;
BT_DBG("Queued %p (queue len %d)", skb, BT_DBG("Queued %p (queue len %d)", skb,
skb_queue_len(&chan->srej_q)); skb_queue_len(&chan->srej_q));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment