[PATCH 4/4] dm thin metadata: use true, false for bool variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixes coccicheck warning:

drivers/md/dm-thin-metadata.c:814:3-14: WARNING: Assignment of 0/1 to bool variable
drivers/md/dm-thin-metadata.c:1109:1-12: WARNING: Assignment of 0/1 to bool variable
drivers/md/dm-thin-metadata.c:1621:1-12: WARNING: Assignment of 0/1 to bool variable
drivers/md/dm-thin-metadata.c:1652:1-12: WARNING: Assignment of 0/1 to bool variable
drivers/md/dm-thin-metadata.c:1706:1-12: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
Signed-off-by: zhengbin <zhengbin13@xxxxxxxxxx>
---
 drivers/md/dm-thin-metadata.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c
index b88d6d7..ca03b38 100644
--- a/drivers/md/dm-thin-metadata.c
+++ b/drivers/md/dm-thin-metadata.c
@@ -811,7 +811,7 @@ static int __write_changed_details(struct dm_pool_metadata *pmd)
 			return r;

 		if (td->open_count)
-			td->changed = 0;
+			td->changed = false;
 		else {
 			list_del(&td->list);
 			kfree(td);
@@ -1106,7 +1106,7 @@ static int __set_snapshot_details(struct dm_pool_metadata *pmd,
 	if (r)
 		return r;

-	td->changed = 1;
+	td->changed = true;
 	td->snapshotted_time = time;

 	snap->mapped_blocks = td->mapped_blocks;
@@ -1618,7 +1618,7 @@ static int __insert(struct dm_thin_device *td, dm_block_t block,
 	if (r)
 		return r;

-	td->changed = 1;
+	td->changed = true;
 	if (inserted)
 		td->mapped_blocks++;

@@ -1649,7 +1649,7 @@ static int __remove(struct dm_thin_device *td, dm_block_t block)
 		return r;

 	td->mapped_blocks--;
-	td->changed = 1;
+	td->changed = true;

 	return 0;
 }
@@ -1703,7 +1703,7 @@ static int __remove_range(struct dm_thin_device *td, dm_block_t begin, dm_block_
 	}

 	td->mapped_blocks -= total_count;
-	td->changed = 1;
+	td->changed = true;

 	/*
 	 * Reinsert the mapping tree.
--
2.7.4


--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux