Skip to content

Commit f1e4675

Browse files
Christoph Hellwigaxboe
authored andcommitted
bcache: work around a __bitwise to bool conversion sparse warning
Sparse is a bit dumb about bitwise operation on __bitwise types used in boolean contexts. Add a !! to explicitly propagate to boolean without a warning. Fixes: fcf865e ("block: convert features and flags to __bitwise types") Reported-by: kernel test robot <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Kent Overstreet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 18048c1 commit f1e4675

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/md/bcache/super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,8 +1416,8 @@ static int cached_dev_init(struct cached_dev *dc, unsigned int block_size)
14161416
}
14171417

14181418
if (bdev_io_opt(dc->bdev))
1419-
dc->partial_stripes_expensive = q->limits.features &
1420-
BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE;
1419+
dc->partial_stripes_expensive = !!(q->limits.features &
1420+
BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE);
14211421

14221422
ret = bcache_device_init(&dc->disk, block_size,
14231423
bdev_nr_sectors(dc->bdev) - dc->sb.data_offset,

0 commit comments

Comments
 (0)