From: Brian Foster <bfoster@redhat.com>
To: Thomas Meyer <thomas@m3y3r.de>
Cc: darrick.wong@oracle.com, linux-xfs@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] xfs: Fix bool initialization/comparison
Date: Mon, 9 Oct 2017 10:24:26 -0400 [thread overview]
Message-ID: <20171009142426.GA18663@bfoster.bfoster> (raw)
In-Reply-To: <1507383097088-1367347759-14-diffsplit-thomas@m3y3r.de>
On Sat, Oct 07, 2017 at 04:02:21PM +0200, Thomas Meyer wrote:
> Bool initializations should use true and false. Bool tests don't need
> comparisons.
>
> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
>
> diff -u -p a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -1490,14 +1490,14 @@ xfs_bmap_isaeof(
> int is_empty;
> int error;
>
> - bma->aeof = 0;
> + bma->aeof = false;
> error = xfs_bmap_last_extent(NULL, bma->ip, whichfork, &rec,
> &is_empty);
> if (error)
> return error;
>
> if (is_empty) {
> - bma->aeof = 1;
> + bma->aeof = true;
> return 0;
> }
>
> diff -u -p a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
> --- a/fs/xfs/libxfs/xfs_ialloc.c
> +++ b/fs/xfs/libxfs/xfs_ialloc.c
> @@ -1962,7 +1962,7 @@ xfs_difree_inobt(
> if (!(mp->m_flags & XFS_MOUNT_IKEEP) &&
> rec.ir_free == XFS_INOBT_ALL_FREE &&
> mp->m_sb.sb_inopblock <= XFS_INODES_PER_CHUNK) {
> - xic->deleted = 1;
> + xic->deleted = true;
> xic->first_ino = XFS_AGINO_TO_INO(mp, agno, rec.ir_startino);
> xic->alloc = xfs_inobt_irec_to_allocmask(&rec);
>
> @@ -1989,7 +1989,7 @@ xfs_difree_inobt(
>
> xfs_difree_inode_chunk(mp, agno, &rec, dfops);
> } else {
> - xic->deleted = 0;
> + xic->deleted = false;
>
> error = xfs_inobt_update(cur, &rec);
> if (error) {
> diff -u -p a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -761,7 +761,7 @@ xfs_file_fallocate(
> enum xfs_prealloc_flags flags = 0;
> uint iolock = XFS_IOLOCK_EXCL;
> loff_t new_size = 0;
> - bool do_file_insert = 0;
> + bool do_file_insert = false;
>
> if (!S_ISREG(inode->i_mode))
> return -EINVAL;
> @@ -822,7 +822,7 @@ xfs_file_fallocate(
> error = -EINVAL;
> goto out_unlock;
> }
> - do_file_insert = 1;
> + do_file_insert = true;
> } else {
> flags |= XFS_PREALLOC_SET;
>
> diff -u -p a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -2515,7 +2515,7 @@ next_lv:
> if (lv)
> vecp = lv->lv_iovecp;
> }
> - if (record_cnt == 0 && ordered == false) {
> + if (record_cnt == 0 && !ordered) {
> if (!lv)
> return 0;
> break;
> diff -u -p a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
> --- a/fs/xfs/xfs_mount.c
> +++ b/fs/xfs/xfs_mount.c
> @@ -704,7 +704,7 @@ xfs_mountfs(
> xfs_set_maxicount(mp);
>
> /* enable fail_at_unmount as default */
> - mp->m_fail_unmount = 1;
> + mp->m_fail_unmount = true;
>
> error = xfs_sysfs_init(&mp->m_kobj, &xfs_mp_ktype, NULL, mp->m_fsname);
> if (error)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-10-09 14:24 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-07 14:02 Cocci spatch "boolinit" - v4.14-rc1 Thomas Meyer
2017-10-07 14:02 ` [PATCH] f2fs: Fix bool initialization/comparison Thomas Meyer
2017-10-07 14:02 ` Thomas Meyer
2017-10-07 14:33 ` [f2fs-dev] " Ju Hyung Park
2017-10-07 19:30 ` Joe Perches
2017-10-09 1:48 ` Chao Yu
2017-10-09 1:48 ` Chao Yu
2017-10-10 17:41 ` Jaegeuk Kim
2017-10-07 14:02 ` [PATCH] cifs: " Thomas Meyer
[not found] ` <1507383097083-1243109004-5-diffsplit-thomas-VsYtu1Qij5c@public.gmane.org>
2017-10-10 1:14 ` Nico Kadel-Garcia
2017-10-10 1:14 ` Nico Kadel-Garcia
2017-10-07 14:02 ` [PATCH] ima: " Thomas Meyer
2017-10-07 14:02 ` Thomas Meyer
2017-10-07 14:02 ` [PATCH] nfsd: " Thomas Meyer
2017-10-07 14:02 ` [PATCH] NFS: " Thomas Meyer
2017-10-07 14:02 ` [PATCH] pstore: " Thomas Meyer
2018-11-29 23:21 ` Kees Cook
2017-10-07 14:02 ` [PATCH] afs: " Thomas Meyer
2017-10-07 14:02 ` [PATCH] xfs: " Thomas Meyer
2017-10-09 14:24 ` Brian Foster [this message]
2017-10-07 14:02 ` [PATCH] ceph: " Thomas Meyer
2017-10-09 1:52 ` Yan, Zheng
2017-10-07 14:02 ` [PATCH] bfq: " Thomas Meyer
2017-10-07 14:02 ` [PATCH] proc: " Thomas Meyer
2017-10-07 14:02 ` [PATCH] exofs: " Thomas Meyer
2017-10-07 14:02 ` [PATCH] apparmor: " Thomas Meyer
2017-10-07 14:02 ` Thomas Meyer
2017-10-07 17:18 ` John Johansen
2017-10-07 17:18 ` John Johansen
2017-10-07 14:02 ` [PATCH] ext4: " Thomas Meyer
2017-10-07 14:02 ` [PATCH] btrfs: " Thomas Meyer
2017-10-09 16:05 ` David Sterba
2017-10-07 14:02 ` [PATCH] selinux: " Thomas Meyer
2017-10-07 14:02 ` Thomas Meyer
2017-10-10 23:17 ` Casey Schaufler
2017-10-10 23:17 ` Casey Schaufler
2017-10-10 23:19 ` Casey Schaufler
2017-10-10 23:19 ` Casey Schaufler
2017-10-13 22:40 ` Paul Moore
2017-10-13 22:40 ` Paul Moore
2017-10-07 14:02 ` [PATCH] configfs: " Thomas Meyer
2017-10-19 14:08 ` Christoph Hellwig
2017-10-10 15:19 ` [PATCH] afs: " David Howells
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=20171009142426.GA18663@bfoster.bfoster \
--to=bfoster@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=thomas@m3y3r.de \
/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.