diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-07-26 17:12:23 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-07-26 21:30:07 +0300 |
commit | 8d9fdb6011b4d413271eba3a62e10f89efecc419 (patch) | |
tree | 0c5966972333ea5aa4d4832b28d86ab6bd0a35c9 /drivers/block | |
parent | 6d8c5afc9ab14595707ff25d971dde45728eba3e (diff) | |
download | linux-8d9fdb6011b4d413271eba3a62e10f89efecc419.tar.xz |
ublk_drv: fix double shift bug
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: fa362045564e ("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>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/ublk_drv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index 255b2de46a24..3f1906965ac8 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -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; |