From 68d1ae26d6fff47ebae64f1e11c18be6e2da1bab Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Wed, 4 Oct 2023 23:33:21 +0100 Subject: [PATCH] block: virtual-storage: Drop version check The function blk_mq_alloc_request() has been exported in the Linux kernel since v3.16 and the function blk_mq_free_request() has been exported in the Linux kernel since v3.19. The function Since Linux v5.0, blk_get_request() has always called blk_mq_alloc_request() and blk_put_request() has always called blk_mq_free_request(). Given that kernels newer than v5.0 are now supported drop the version check around blk_mq_alloc_request() and blk_mq_free_request() and always use these functions. Bug 4119327 Change-Id: I018687b340acaa9617c81551efb436a0439b14f1 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2991457 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/block/tegra_virt_storage/tegra_hv_ioctl.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/block/tegra_virt_storage/tegra_hv_ioctl.c b/drivers/block/tegra_virt_storage/tegra_hv_ioctl.c index ac9bbd9a..287977b3 100644 --- a/drivers/block/tegra_virt_storage/tegra_hv_ioctl.c +++ b/drivers/block/tegra_virt_storage/tegra_hv_ioctl.c @@ -123,11 +123,7 @@ int vblk_submit_ioctl_req(struct block_device *bdev, if (err) goto free_ioctl_req; -#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE rq = blk_mq_alloc_request(vblkdev->queue, REQ_OP_DRV_IN, BLK_MQ_REQ_NOWAIT); -#else - rq = blk_get_request(vblkdev->queue, REQ_OP_DRV_IN, BLK_MQ_REQ_NOWAIT); -#endif if (IS_ERR_OR_NULL(rq)) { dev_err(vblkdev->device, "Failed to get handle to a request!\n"); @@ -143,11 +139,7 @@ int vblk_submit_ioctl_req(struct block_device *bdev, blk_execute_rq(vblkdev->gd, rq, 0); #endif -#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE blk_mq_free_request(rq); -#else - blk_put_request(rq); -#endif switch (cmd) { case SG_IO: