From: Peter Senna Tschudin <peter.senna@gmail.com>
To: marcel@holtmann.org
Cc: gustavo@padovan.org, johan.hedberg@gmail.com,
davem@davemloft.net, linux-bluetooth@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org,
Peter Senna Tschudin <peter.senna@gmail.com>
Subject: [PATCH 2/5] Bluetooth: Fix assignment of 0/1 to bool variables
Date: Sun, 22 Sep 2013 20:44:10 +0200 [thread overview]
Message-ID: <1379875453-20083-2-git-send-email-peter.senna@gmail.com> (raw)
In-Reply-To: <1379875453-20083-1-git-send-email-peter.senna@gmail.com>
Convert 0 to false and 1 to true when assigning values to bool
variables. Inspired by commit 3db1cd5c05f35fb43eb134df6f321de4e63141f2.
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: Peter Senna Tschudin <peter.senna@gmail.com>
---
net/bluetooth/l2cap_core.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff -u -p a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -5797,7 +5797,7 @@ static int l2cap_rx_state_recv(struct l2
struct sk_buff *skb, u8 event)
{
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,
event);
@@ -5818,7 +5818,7 @@ static int l2cap_rx_state_recv(struct l2
control->txseq);
chan->buffer_seq = chan->expected_tx_seq;
- skb_in_use = 1;
+ skb_in_use = true;
err = l2cap_reassemble_sdu(chan, skb, control);
if (err)
@@ -5854,7 +5854,7 @@ static int l2cap_rx_state_recv(struct l2
* current frame is stored for later use.
*/
skb_queue_tail(&chan->srej_q, skb);
- skb_in_use = 1;
+ skb_in_use = true;
BT_DBG("Queued %p (queue len %d)", skb,
skb_queue_len(&chan->srej_q));
@@ -5932,7 +5932,7 @@ static int l2cap_rx_state_srej_sent(stru
{
int err = 0;
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,
event);
@@ -5944,7 +5944,7 @@ static int l2cap_rx_state_srej_sent(stru
/* Keep frame for reassembly later */
l2cap_pass_to_tx(chan, control);
skb_queue_tail(&chan->srej_q, skb);
- skb_in_use = 1;
+ skb_in_use = true;
BT_DBG("Queued %p (queue len %d)", skb,
skb_queue_len(&chan->srej_q));
@@ -5955,7 +5955,7 @@ static int l2cap_rx_state_srej_sent(stru
l2cap_pass_to_tx(chan, control);
skb_queue_tail(&chan->srej_q, skb);
- skb_in_use = 1;
+ skb_in_use = true;
BT_DBG("Queued %p (queue len %d)", skb,
skb_queue_len(&chan->srej_q));
@@ -5970,7 +5970,7 @@ static int l2cap_rx_state_srej_sent(stru
* the missing frames.
*/
skb_queue_tail(&chan->srej_q, skb);
- skb_in_use = 1;
+ skb_in_use = true;
BT_DBG("Queued %p (queue len %d)", skb,
skb_queue_len(&chan->srej_q));
@@ -5984,7 +5984,7 @@ static int l2cap_rx_state_srej_sent(stru
* SREJ'd frames.
*/
skb_queue_tail(&chan->srej_q, skb);
- skb_in_use = 1;
+ skb_in_use = true;
BT_DBG("Queued %p (queue len %d)", skb,
skb_queue_len(&chan->srej_q));
next prev parent reply other threads:[~2013-09-22 18:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-22 18:44 [PATCH 1/5] scsi: Fix assignment of 0/1 to bool variables Peter Senna Tschudin
2013-09-22 18:44 ` Peter Senna Tschudin [this message]
2013-09-22 18:58 ` [PATCH 2/5] Bluetooth: " Marcel Holtmann
2013-09-22 22:21 ` Gustavo Padovan
2013-09-22 18:44 ` [PATCH 3/5] OMAPDSS: DISPC: " Peter Senna Tschudin
2013-09-23 7:37 ` Tomi Valkeinen
2013-09-22 18:44 ` [PATCH 4/5] ALSA: " Peter Senna Tschudin
2013-09-26 7:57 ` Takashi Iwai
2013-09-22 18:44 ` [PATCH 5/5] Staging: crystalhd: " Peter Senna Tschudin
2013-09-23 0:29 ` [PATCH 1/5] scsi: " Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1379875453-20083-2-git-send-email-peter.senna@gmail.com \
--to=peter.senna@gmail.com \
--cc=davem@davemloft.net \
--cc=gustavo@padovan.org \
--cc=johan.hedberg@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).