History

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.

Dan Carpenter committed 4 years ago

Commit 8d9fdb61 parent 6d8c5af1 file · +2 −2Browse files

Unified · Split

drivers/block/ublk_drv.c+2−2
@@ -127,8 +127,8 @@ struct ublk_device { · 126 unmodified lines
127 struct cdev cdev;127 struct cdev cdev;
128 struct device cdev_dev;128 struct device cdev_dev;
129 129
130#define UB_STATE_OPEN (1 << 0)130#define UB_STATE_OPEN 0
131#define UB_STATE_USED (1 << 1)131#define UB_STATE_USED 1
132 unsigned long state;132 unsigned long state;
133 int ub_number;133 int ub_number;
134 134