linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Senna Tschudin <peter.senna@gmail.com>
To: JBottomley@parallels.com
Cc: naresh@chelsio.com, davem@davemloft.net, jj@chaosbits.net,
	arvindb@chelsio.com, hare@suse.de, michaelc@cs.wisc.edu,
	vijay.chauhan@netapp.com, bvanassche@acm.org,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org,
	Peter Senna Tschudin <peter.senna@gmail.com>
Subject: [PATCH 1/5] scsi: Fix assignment of 0/1 to bool variables
Date: Sun, 22 Sep 2013 20:44:09 +0200	[thread overview]
Message-ID: <1379875453-20083-1-git-send-email-peter.senna@gmail.com> (raw)

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>

---
 drivers/scsi/csiostor/csio_hw.c            |    4 ++--
 drivers/scsi/cxgbi/libcxgbi.c              |    4 ++--
 drivers/scsi/device_handler/scsi_dh_alua.c |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff -u -p a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -1603,7 +1603,7 @@ static int skb_read_pdu_data(struct iscs
 			     struct sk_buff *skb, unsigned int offset)
 {
 	struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
-	bool offloaded = 0;
+	bool offloaded = false;
 	int opcode = tcp_conn->in.hdr->opcode & ISCSI_OPCODE_MASK;
 
 	log_debug(1 << CXGBI_DBG_PDU_RX,
@@ -1626,7 +1626,7 @@ static int skb_read_pdu_data(struct iscs
 		offset += ISCSI_DIGEST_SIZE;
 
 	if (cxgbi_skcb_test_flag(lskb, SKCBF_RX_DATA_DDPD))
-		offloaded = 1;
+		offloaded = true;
 
 	if (opcode == ISCSI_OP_SCSI_DATA_IN)
 		log_debug(1 << CXGBI_DBG_PDU_RX,
diff -u -p a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -528,7 +528,7 @@ static int alua_rtpg(struct scsi_device
 	int len, k, off, valid_states = 0;
 	unsigned char *ucp;
 	unsigned err;
-	bool rtpg_ext_hdr_req = 1;
+	bool rtpg_ext_hdr_req = true;
 	unsigned long expiry, interval = 0;
 	unsigned int tpg_desc_tbl_off;
 	unsigned char orig_transition_tmo;
@@ -558,7 +558,7 @@ static int alua_rtpg(struct scsi_device
 		if (rtpg_ext_hdr_req == 1 &&
 		    sense_hdr.sense_key == ILLEGAL_REQUEST &&
 		    sense_hdr.asc == 0x24 && sense_hdr.ascq == 0) {
-			rtpg_ext_hdr_req = 0;
+			rtpg_ext_hdr_req = false;
 			goto retry;
 		}
 
diff -u -p a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c
--- a/drivers/scsi/csiostor/csio_hw.c
+++ b/drivers/scsi/csiostor/csio_hw.c
@@ -3476,7 +3476,7 @@ csio_process_fwevtq_entry(struct csio_hw
 	__u8 op;
 	void *msg = NULL;
 	uint32_t msg_len = 0;
-	bool msg_sg = 0;
+	bool msg_sg = false;
 
 	op = ((struct rss_header *) wr)->opcode;
 	if (op == CPL_FW6_PLD) {
@@ -3488,7 +3488,7 @@ csio_process_fwevtq_entry(struct csio_hw
 
 		msg = (void *) flb;
 		msg_len = flb->totlen;
-		msg_sg = 1;
+		msg_sg = true;
 	} else if (op == CPL_FW6_MSG || op == CPL_FW4_MSG) {
 
 		CSIO_INC_STATS(hw, n_cpl_fw6_msg);


             reply	other threads:[~2013-09-22 18:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-22 18:44 Peter Senna Tschudin [this message]
2013-09-22 18:44 ` [PATCH 2/5] Bluetooth: Fix assignment of 0/1 to bool variables Peter Senna Tschudin
2013-09-22 18:58   ` 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-1-git-send-email-peter.senna@gmail.com \
    --to=peter.senna@gmail.com \
    --cc=JBottomley@parallels.com \
    --cc=arvindb@chelsio.com \
    --cc=bvanassche@acm.org \
    --cc=davem@davemloft.net \
    --cc=hare@suse.de \
    --cc=jj@chaosbits.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    --cc=naresh@chelsio.com \
    --cc=vijay.chauhan@netapp.com \
    /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).