From: Richard Knutsson <ricknu-0@student.ltu.se>
To: akpm@osdl.org, xfs-masters@oss.sgi.com, nathans@sgi.com
Cc: xfs@oss.sgi.com, linux-kernel@vger.kernel.org
Subject: [PATCH 2.6.18-rc4-mm3 2/2] fs/xfs: Correcting error-prone boolean-statement
Date: Fri, 01 Sep 2006 01:52:51 +0200 [thread overview]
Message-ID: <44F77653.6000606@student.ltu.se> (raw)
From: Richard Knutsson <ricknu-0@student.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@student.ltu.se>
---
Compile-tested
Please Cc: since I'm not on xfs@oss.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);
next reply other threads:[~2006-08-31 23:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-31 23:52 Richard Knutsson [this message]
2006-09-01 0:07 ` [PATCH 2.6.18-rc4-mm3 2/2] fs/xfs: Correcting error-prone boolean-statement Nathan Scott
2006-09-01 1:18 ` Richard Knutsson
2006-09-01 1:16 ` Nathan Scott
2006-09-01 1:38 ` Richard Knutsson
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=44F77653.6000606@student.ltu.se \
--to=ricknu-0@student.ltu.se \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathans@sgi.com \
--cc=xfs-masters@oss.sgi.com \
--cc=xfs@oss.sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.