提交 8d9fdb60 编写于 作者: D Dan Carpenter 提交者: Jens Axboe

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: fa362045 ("ublk: simplify ublk_ch_open and ublk_ch_release")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/Yt/2R/+MJf/MSoyl@kiliSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 6d8c5afc
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册