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.
Unified · Split
| @@ -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 | ||