]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcache: work around a __bitwise to bool conversion sparse warning
authorChristoph Hellwig <hch@lst.de>
Fri, 28 Jun 2024 13:16:48 +0000 (15:16 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 28 Jun 2024 16:25:00 +0000 (10:25 -0600)
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: fcf865e357f8 ("block: convert features and flags to __bitwise types")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Kent Overstreet <kent.overstreet@linux.dev>
Link: https://lore.kernel.org/r/20240628131657.667797-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/super.c

index 283b2511c6d21fc4057a0bc8cc36fef510c24949..b5d6ef430b86fcc0f62e75eedf971ec8f87dd5f9 100644 (file)
@@ -1416,8 +1416,8 @@ static int cached_dev_init(struct cached_dev *dc, unsigned int block_size)
        }
 
        if (bdev_io_opt(dc->bdev))
-               dc->partial_stripes_expensive = q->limits.features &
-                       BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE;
+               dc->partial_stripes_expensive = !!(q->limits.features &
+                       BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE);
 
        ret = bcache_device_init(&dc->disk, block_size,
                         bdev_nr_sectors(dc->bdev) - dc->sb.data_offset,