mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fabian Frederick <fabf@skynet.be>
To: linux-kernel@vger.kernel.org
Cc: Joe Perches <joe@perches.com>, Jens Axboe <axboe@kernel.dk>,
	Fabian Frederick <fabf@skynet.be>
Subject: [PATCH v2 05/10 linux-next] cdrom: remove bool comparison/assignment to 0/1
Date: Mon, 10 Nov 2014 21:21:50 +0100	[thread overview]
Message-ID: <1415650916-9975-6-git-send-email-fabf@skynet.be> (raw)
In-Reply-To: <1415650916-9975-1-git-send-email-fabf@skynet.be>

Fix the following coccinelle warnings:

drivers/cdrom/cdrom.c:615:5-14: WARNING: Comparison of bool to 0/1
drivers/cdrom/cdrom.c:617:5-14: WARNING: Comparison of bool to 0/1
drivers/cdrom/cdrom.c:619:5-13: WARNING: Comparison of bool to 0/1
drivers/cdrom/cdrom.c:621:5-21: WARNING: Comparison of bool to 0/1
drivers/cdrom/cdrom.c:317:28-33: WARNING: Comparison of bool to 0/1
drivers/cdrom/cdrom.c:323:33-38: WARNING: Comparison of bool to 0/1
drivers/cdrom/cdrom.c:289:12-21: WARNING: Assignment of bool to 0/1
drivers/cdrom/cdrom.c:291:12-20: WARNING: Assignment of bool to 0/1
drivers/cdrom/cdrom.c:295:12-30: WARNING: Assignment of bool to 0/1

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/cdrom/cdrom.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index ca47919..a4dd382 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -286,13 +286,13 @@
 /* used to tell the module to turn on full debugging messages */
 static bool debug;
 /* default compatibility mode */
-static bool autoclose = 1;
+static bool autoclose = true;
 static bool autoeject;
-static bool lockdoor = 1;
+static bool lockdoor = true;
 /* will we ever get to use this... sigh. */
 static bool check_media_type;
 /* automatically restart mrw format */
-static bool mrw_format_restart = 1;
+static bool mrw_format_restart = true;
 module_param(debug, bool, 0);
 module_param(autoclose, bool, 0);
 module_param(autoeject, bool, 0);
@@ -314,13 +314,13 @@ static const char * const mrw_address_space[] = { "DMA", "GAA" };
 #if (ERRLOGMASK != CD_NOTHING)
 #define cd_dbg(type, fmt, ...)				\
 do {							\
-	if ((ERRLOGMASK & type) || debug == 1)		\
+	if ((ERRLOGMASK & type) || debug)		\
 		pr_debug(fmt, ##__VA_ARGS__);		\
 } while (0)
 #else
 #define cd_dbg(type, fmt, ...)				\
 do {							\
-	if (0 && (ERRLOGMASK & type) || debug == 1)	\
+	if (0 && (ERRLOGMASK & type) || debug)		\
 		pr_debug(fmt, ##__VA_ARGS__);		\
 } while (0)
 #endif
@@ -612,13 +612,13 @@ int register_cdrom(struct cdrom_device_info *cdi)
 	cdo->n_minors = 0;
 	cdi->options = CDO_USE_FFLAGS;
 
-	if (autoclose == 1 && CDROM_CAN(CDC_CLOSE_TRAY))
+	if (autoclose && CDROM_CAN(CDC_CLOSE_TRAY))
 		cdi->options |= (int) CDO_AUTO_CLOSE;
-	if (autoeject == 1 && CDROM_CAN(CDC_OPEN_TRAY))
+	if (autoeject && CDROM_CAN(CDC_OPEN_TRAY))
 		cdi->options |= (int) CDO_AUTO_EJECT;
-	if (lockdoor == 1)
+	if (lockdoor)
 		cdi->options |= (int) CDO_LOCK;
-	if (check_media_type == 1)
+	if (check_media_type)
 		cdi->options |= (int) CDO_CHECK_TYPE;
 
 	if (CDROM_CAN(CDC_MRW_W))
-- 
1.9.1


  parent reply	other threads:[~2014-11-10 20:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-10 20:21 [PATCH v2 00/10 linux-next] cdrom: sysctl export + clean-up Fabian Frederick
2014-11-10 20:21 ` [PATCH v2 01/10 linux-next] cdrom: include linux/uaccess.h instead of asm/uaccess.h Fabian Frederick
2014-11-10 20:21 ` [PATCH v2 02/10 linux-next] cdrom: use static const char * const where possible Fabian Frederick
2014-11-10 20:21 ` [PATCH v2 03/10 linux-next] cdrom: fix spaces required errors Fabian Frederick
2014-11-10 20:21 ` [PATCH v2 04/10 linux-next] cdrom: move EXPORT_SYMBOL after functions Fabian Frederick
2014-11-10 20:21 ` Fabian Frederick [this message]
2014-11-10 20:21 ` [PATCH v2 06/10 linux-next] cdrom: use bool for true/false initialized variable Fabian Frederick
2014-11-10 20:21 ` [PATCH v2 07/10 linux-next] cdrom: export sysctl code Fabian Frederick
2014-11-10 20:21 ` [PATCH v2 08/10 linux-next] cdrom: fix init_cdrom_command in dvd_do_auth Fabian Frederick
2014-11-10 20:21 ` [PATCH v2 09/10 linux-next] cdrom: remove unnecessary status Fabian Frederick
2014-11-10 20:24 ` [PATCH v2 10/10 linux-next] cdrom: uniformize lba command initialization Fabian Frederick
2014-11-10 20:54 ` [PATCH v2 00/10 linux-next] cdrom: sysctl export + clean-up Joe Perches
2014-11-10 22:21   ` Jens Axboe
2014-11-10 22:24     ` Joe Perches
2014-11-10 22:20 ` Jens Axboe

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=1415650916-9975-6-git-send-email-fabf@skynet.be \
    --to=fabf@skynet.be \
    --cc=axboe@kernel.dk \
    --cc=joe@perches.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®