]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ublk_drv: fix double shift bug
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 26 Jul 2022 14:12:23 +0000 (17:12 +0300)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 Jul 2022 18:30:07 +0000 (12:30 -0600)
The test/clear_bit() functions take a bit number, but this code is
passing as shifted value.  It's the equivalent of saying BIT(BIT(0))
instead of just BIT(0).

This doesn't affect runtime because numbers are small and it's done
consistently.

Fixes: e2fbb2da2476 ("ublk: simplify ublk_ch_open and ublk_ch_release")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/Yt/2R/+MJf/MSoyl@kili
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c

index 255b2de46a240fa4b92cb9cfc1d3373b6e039d95..3f1906965ac8051742d82de736258e879537b56c 100644 (file)
@@ -127,8 +127,8 @@ struct ublk_device {
        struct cdev             cdev;
        struct device           cdev_dev;
 
-#define UB_STATE_OPEN          (1 << 0)
-#define UB_STATE_USED          (1 << 1)
+#define UB_STATE_OPEN          0
+#define UB_STATE_USED          1
        unsigned long           state;
        int                     ub_number;