There are two slightly different _get_ldev_if_state() implementations in the DRBD source code. Keep the version that is used. This does not affect C=1 / C=2 builds because lock context checking is performed by Clang instead of sparse since commit 5b63d0ae94cc ("compiler-context- analysis: Remove Sparse support"). Signed-off-by: Bart Van Assche --- drivers/block/drbd/drbd_int.h | 7 ++----- drivers/block/drbd/drbd_main.c | 19 ------------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index aa39c4d19133..bba52252fbac 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h @@ -2033,8 +2033,8 @@ static inline void put_ldev(struct drbd_device *device) } } -#ifndef __CHECKER__ -static inline int _get_ldev_if_state(struct drbd_device *device, enum drbd_disk_state mins) +static inline int _get_ldev_if_state(struct drbd_device *device, + enum drbd_disk_state mins) { int io_allowed; @@ -2048,9 +2048,6 @@ static inline int _get_ldev_if_state(struct drbd_device *device, enum drbd_disk_ put_ldev(device); return io_allowed; } -#else -int _get_ldev_if_state(struct drbd_device *device, enum drbd_disk_state mins); -#endif /* this throttles on-the-fly application requests * according to max_buffers settings; diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index a2a841c89201..dbf6e413db03 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -128,25 +128,6 @@ static const struct block_device_operations drbd_ops = { .release = drbd_release, }; -#ifdef __CHECKER__ -/* When checking with sparse, and this is an inline function, sparse will - give tons of false positives. When this is a real functions sparse works. - */ -int _get_ldev_if_state(struct drbd_device *device, enum drbd_disk_state mins) -{ - int io_allowed; - - atomic_inc(&device->local_cnt); - io_allowed = (device->state.disk >= mins); - if (!io_allowed) { - if (atomic_dec_and_test(&device->local_cnt)) - wake_up(&device->misc_wait); - } - return io_allowed; -} - -#endif - /** * tl_release() - mark as BARRIER_ACKED all requests in the corresponding transfer log epoch * @connection: DRBD connection.