Skip to contentSkip to conversation

ext4: remove unnecessary comparisons to bool

PATCH Applied Jason Yan 3 participants 3 messages Apr 20, 2020 – May 14, 2020 ext4 file system

lore
Share & tools
lore

Jason Yan

author
#0 lore raw

PATCH 1/1 ext4: remove unnecessary comparisons to bool

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

---
 fs/ext4/extents_status.c | 2 +-
 fs/ext4/inode.c          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
fs/ext4/extents_status.c +1 -1
index d996b44d2265..e75171535375 100644
@@ -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;
 	}
fs/ext4/inode.c +1 -1
index 2a4aae6acdcb..acb8fedcba76 100644
@@ -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);
Signature · 1 line
2.21.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · 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

Thanks for the patch. Looks good to me.

Feel free to add:

Quoted 32 lines
---
  fs/ext4/extents_status.c | 2 +-
  fs/ext4/inode.c          | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
fs/ext4/extents_status.c +1 -1
index d996b44d2265..e75171535375 100644
@@ -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;
  	}
fs/ext4/inode.c +1 -1
index 2a4aae6acdcb..acb8fedcba76 100644
@@ -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);