Skip to content

Commit

Permalink
dm thin: clean up compiler warning
Browse files Browse the repository at this point in the history
Clean up "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.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Mike Snitzer authored and Alasdair G Kergon committed Jul 27, 2012
1 parent 7768ed3 commit 17b7d63
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/md/dm-thin-metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/md/dm-thin-metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

/*
Expand Down
2 changes: 1 addition & 1 deletion drivers/md/dm-thin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 17b7d63

Please sign in to comment.