lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1414792084-7739-6-git-send-email-fabf@skynet.be>
Date:	Fri, 31 Oct 2014 22:48:01 +0100
From:	Fabian Frederick <fabf@...net.be>
To:	linux-kernel@...r.kernel.org
Cc:	Jens Axboe <axboe@...nel.dk>, Fabian Frederick <fabf@...net.be>
Subject: [PATCH 5/8] cdrom: remove bool comparison/assignment to 0/1

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@...net.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.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ