Skip to content

Commit

Permalink
dm snapshot: use true/false for bool variable
Browse files Browse the repository at this point in the history
Fixes coccicheck warning:

drivers/md/dm-snap.c:1064:3-18: WARNING: Assignment of 0/1 to bool variable
drivers/md/dm-snap.c:1152:1-16: WARNING: Assignment of 0/1 to bool variable
drivers/md/dm-snap.c:1317:1-16: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
zhengbin authored and Mike Snitzer committed Jan 7, 2020
1 parent 67b92d9 commit 1d1dda8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/md/dm-snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ static void snapshot_merge_next_chunks(struct dm_snapshot *s)
DMERR("Read error in exception store: "
"shutting down merge");
down_write(&s->lock);
s->merge_failed = 1;
s->merge_failed = true;
up_write(&s->lock);
}
goto shut;
Expand Down Expand Up @@ -1149,7 +1149,7 @@ static void merge_callback(int read_err, unsigned long write_err, void *context)

shut:
down_write(&s->lock);
s->merge_failed = 1;
s->merge_failed = true;
b = __release_queued_bios_after_merge(s);
up_write(&s->lock);
error_bios(b);
Expand Down Expand Up @@ -1314,7 +1314,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
INIT_LIST_HEAD(&s->list);
spin_lock_init(&s->pe_lock);
s->state_bits = 0;
s->merge_failed = 0;
s->merge_failed = false;
s->first_merging_chunk = 0;
s->num_merging_chunks = 0;
bio_list_init(&s->bios_queued_during_merge);
Expand Down

0 comments on commit 1d1dda8

Please sign in to comment.