linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: remove unnecessary comparisons to bool
@ 2020-04-20  4:29 Jason Yan
  2020-04-20  4:54 ` Ritesh Harjani
  2020-05-14 14:47 ` Theodore Y. Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: Jason Yan @ 2020-04-20  4:29 UTC (permalink / raw)
  To: tytso, adilger.kernel, enwlinux, linux-ext4, linux-kernel; +Cc: Jason Yan

Fix the following coccicheck warning:

fs/ext4/extents_status.c:1057:5-28: WARNING: Comparison to bool
fs/ext4/inode.c:2314:18-24: WARNING: Comparison to bool

Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
 fs/ext4/extents_status.c | 2 +-
 fs/ext4/inode.c          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
index d996b44d2265..e75171535375 100644
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -1054,7 +1054,7 @@ static void count_rsvd(struct inode *inode, ext4_lblk_t lblk, long len,
 	end = (end > ext4_es_end(es)) ? ext4_es_end(es) : end;
 
 	/* record the first block of the first delonly extent seen */
-	if (rc->first_do_lblk_found == false) {
+	if (!rc->first_do_lblk_found) {
 		rc->first_do_lblk = i;
 		rc->first_do_lblk_found = true;
 	}
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 2a4aae6acdcb..acb8fedcba76 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2311,7 +2311,7 @@ static int mpage_map_and_submit_buffers(struct mpage_da_data *mpd)
 			 * mapping, or maybe the page was submitted for IO.
 			 * So we return to call further extent mapping.
 			 */
-			if (err < 0 || map_bh == true)
+			if (err < 0 || map_bh)
 				goto out;
 			/* Page fully mapped - let IO run! */
 			err = mpage_submit_page(mpd, page);
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: remove unnecessary comparisons to bool
  2020-04-20  4:29 [PATCH] ext4: remove unnecessary comparisons to bool Jason Yan
@ 2020-04-20  4:54 ` Ritesh Harjani
  2020-05-14 14:47 ` Theodore Y. Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Ritesh Harjani @ 2020-04-20  4:54 UTC (permalink / raw)
  To: Jason Yan, tytso, adilger.kernel, enwlinux, linux-ext4, linux-kernel



On 4/20/20 9:59 AM, Jason Yan wrote:
> Fix the following coccicheck warning:
> 
> fs/ext4/extents_status.c:1057:5-28: WARNING: Comparison to bool
> fs/ext4/inode.c:2314:18-24: WARNING: Comparison to bool
> 
> Signed-off-by: Jason Yan <yanaijie@huawei.com>

Thanks for the patch. Looks good to me.

Feel free to add:
Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>

> ---
>   fs/ext4/extents_status.c | 2 +-
>   fs/ext4/inode.c          | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
> index d996b44d2265..e75171535375 100644
> --- a/fs/ext4/extents_status.c
> +++ b/fs/ext4/extents_status.c
> @@ -1054,7 +1054,7 @@ static void count_rsvd(struct inode *inode, ext4_lblk_t lblk, long len,
>   	end = (end > ext4_es_end(es)) ? ext4_es_end(es) : end;
> 
>   	/* record the first block of the first delonly extent seen */
> -	if (rc->first_do_lblk_found == false) {
> +	if (!rc->first_do_lblk_found) {
>   		rc->first_do_lblk = i;
>   		rc->first_do_lblk_found = true;
>   	}
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 2a4aae6acdcb..acb8fedcba76 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -2311,7 +2311,7 @@ static int mpage_map_and_submit_buffers(struct mpage_da_data *mpd)
>   			 * mapping, or maybe the page was submitted for IO.
>   			 * So we return to call further extent mapping.
>   			 */
> -			if (err < 0 || map_bh == true)
> +			if (err < 0 || map_bh)
>   				goto out;
>   			/* Page fully mapped - let IO run! */
>   			err = mpage_submit_page(mpd, page);
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: remove unnecessary comparisons to bool
  2020-04-20  4:29 [PATCH] ext4: remove unnecessary comparisons to bool Jason Yan
  2020-04-20  4:54 ` Ritesh Harjani
@ 2020-05-14 14:47 ` Theodore Y. Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Y. Ts'o @ 2020-05-14 14:47 UTC (permalink / raw)
  To: Jason Yan; +Cc: adilger.kernel, enwlinux, linux-ext4, linux-kernel

On Mon, Apr 20, 2020 at 12:29:18PM +0800, Jason Yan wrote:
> Fix the following coccicheck warning:
> 
> fs/ext4/extents_status.c:1057:5-28: WARNING: Comparison to bool
> fs/ext4/inode.c:2314:18-24: WARNING: Comparison to bool
> 
> Signed-off-by: Jason Yan <yanaijie@huawei.com>

Applied, thanks.

					- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-14 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20  4:29 [PATCH] ext4: remove unnecessary comparisons to bool Jason Yan
2020-04-20  4:54 ` Ritesh Harjani
2020-05-14 14:47 ` Theodore Y. Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).