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-next>] [day] [month] [year] [list]
Date:	Fri, 01 Sep 2006 01:52:51 +0200
From:	Richard Knutsson <ricknu-0@...dent.ltu.se>
To:	akpm@...l.org, xfs-masters@....sgi.com, nathans@....com
CC:	xfs@....sgi.com, linux-kernel@...r.kernel.org
Subject: [PATCH 2.6.18-rc4-mm3 2/2] fs/xfs: Correcting error-prone boolean-statement

From: Richard Knutsson <ricknu-0@...dent.ltu.se>

Converting error-prone statement:
"if (var == B_FALSE)" into "if (!var)"
"if (var == B_TRUE)"  into "if (var)"
 
Signed-off-by: Richard Knutsson <ricknu-0@...dent.ltu.se>

---

Compile-tested
Please Cc: since I'm not on xfs@....sgi.com


 xfs_log.c    |    4 ++--
 xfs_vfsops.c |   16 ++++++++--------
 2 files changed, 10 insertions(+), 10 deletions(-)


diff -Narup a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
--- a/fs/xfs/xfs_log.c	2006-08-31 22:03:56.000000000 +0200
+++ b/fs/xfs/xfs_log.c	2006-09-01 00:14:02.000000000 +0200
@@ -3484,7 +3484,7 @@ xlog_verify_iclog(xlog_t	 *log,
 		/* clientid is only 1 byte */
 		field_offset = (__psint_t)
 			       ((xfs_caddr_t)&(ophead->oh_clientid) - base_ptr);
-		if (syncing == B_FALSE || (field_offset & 0x1ff)) {
+		if (!syncing || (field_offset & 0x1ff)) {
 			clientid = ophead->oh_clientid;
 		} else {
 			idx = BTOBBT((xfs_caddr_t)&(ophead->oh_clientid) - iclog->ic_datap);
@@ -3504,7 +3504,7 @@ xlog_verify_iclog(xlog_t	 *log,
 		/* check length */
 		field_offset = (__psint_t)
 			       ((xfs_caddr_t)&(ophead->oh_len) - base_ptr);
-		if (syncing == B_FALSE || (field_offset & 0x1ff)) {
+		if (!syncing || (field_offset & 0x1ff)) {
 			op_len = INT_GET(ophead->oh_len, ARCH_CONVERT);
 		} else {
 			idx = BTOBBT((__psint_t)&ophead->oh_len -
diff -Narup a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
--- a/fs/xfs/xfs_vfsops.c	2006-08-31 22:03:56.000000000 +0200
+++ b/fs/xfs/xfs_vfsops.c	2006-09-01 00:14:36.000000000 +0200
@@ -935,7 +935,7 @@ xfs_sync_inodes(
  * longer be locked.
  */
 #define IPOINTER_INSERT(ip, mp)	{ \
-		ASSERT(ipointer_in == B_FALSE); \
+		ASSERT(!ipointer_in); \
 		ipointer->ip_mnext = ip->i_mnext; \
 		ipointer->ip_mprev = ip; \
 		ip->i_mnext = (xfs_inode_t *)ipointer; \
@@ -952,7 +952,7 @@ xfs_sync_inodes(
  * past us.
  */
 #define IPOINTER_REMOVE(ip, mp)	{ \
-		ASSERT(ipointer_in == B_TRUE); \
+		ASSERT(ipointer_in); \
 		if (ipointer->ip_mnext != (xfs_inode_t *)ipointer) { \
 			ip = ipointer->ip_mnext; \
 			ip->i_mprev = ipointer->ip_mprev; \
@@ -1006,8 +1006,8 @@ xfs_sync_inodes(
 	IPOINTER_CLR;
 
 	do {
-		ASSERT(ipointer_in == B_FALSE);
-		ASSERT(vnode_refed == B_FALSE);
+		ASSERT(!ipointer_in);
+		ASSERT(!vnode_refed);
 
 		lock_flags = base_lock_flags;
 
@@ -1372,7 +1372,7 @@ xfs_sync_inodes(
 				IPOINTER_REMOVE(ip, mp);
 			}
 			XFS_MOUNT_IUNLOCK(mp);
-			ASSERT(ipointer_in == B_FALSE);
+			ASSERT(!ipointer_in);
 			kmem_free(ipointer, sizeof(xfs_iptr_t));
 			return XFS_ERROR(error);
 		}
@@ -1387,21 +1387,21 @@ xfs_sync_inodes(
 			}
 		}
 
-		if (mount_locked == B_FALSE) {
+		if (!mount_locked) {
 			XFS_MOUNT_ILOCK(mp);
 			mount_locked = B_TRUE;
 			IPOINTER_REMOVE(ip, mp);
 			continue;
 		}
 
-		ASSERT(ipointer_in == B_FALSE);
+		ASSERT(!ipointer_in);
 		ip = ip->i_mnext;
 
 	} while (ip != mp->m_inodes);
 
 	XFS_MOUNT_IUNLOCK(mp);
 
-	ASSERT(ipointer_in == B_FALSE);
+	ASSERT(!ipointer_in);
 
 	kmem_free(ipointer, sizeof(xfs_iptr_t));
 	return XFS_ERROR(last_error);


-
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