Skip to contentSkip to conversation

dm thin: cleanup compiler warning

PATCH New Mike Snitzer 1 participant 1 message Jun 13, 2012 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm thin: cleanup compiler warning

Cleanup "warning: dubious: !x & y". Also make it clear that __snapshotted_since() returns a bool and that dm_thin_lookup_result's 'shared' member is a flag.

---
 drivers/md/dm-thin-metadata.c |    2 +-
 drivers/md/dm-thin-metadata.h |    2 +-
 drivers/md/dm-thin.c          |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/md/dm-thin-metadata.c +1 -1
index 3e2907f..c858931 100644
@@ -1262,7 +1262,7 @@ dm_thin_id dm_thin_dev_id(struct dm_thin_device *td)
 	return td->id;
 }
 
-static int __snapshotted_since(struct dm_thin_device *td, uint32_t time)
+static bool __snapshotted_since(struct dm_thin_device *td, uint32_t time)
 {
 	return td->snapshotted_time > time;
 }
drivers/md/dm-thin-metadata.h +1 -1
index b88918c..7b47c0a 100644
@@ -119,7 +119,7 @@ dm_thin_id dm_thin_dev_id(struct dm_thin_device *td);
 
 struct dm_thin_lookup_result {
 	dm_block_t block;
-	int shared;
+	unsigned shared:1;
 };
 
 /*
drivers/md/dm-thin.c +1 -1
index 37fdaf8..b142428 100644
@@ -1218,7 +1218,7 @@ static void process_discard(struct thin_c *tc, struct bio *bio)
 			 */
 			m = get_next_mapping(pool);
 			m->tc = tc;
-			m->pass_discard = (!lookup_result.shared) & pool->pf.discard_passdown;
+			m->pass_discard = (!lookup_result.shared) && pool->pf.discard_passdown;
 			m->virt_block = block;
 			m->data_block = lookup_result.block;
 			m->cell = cell;
Signature · 1 line
1.7.4.4