diff options
author | Jens Axboe <axboe@kernel.dk> | 2021-11-26 17:57:32 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-11-26 17:57:32 +0100 |
commit | d422f40163087408b56290156ba233fc5ada53e4 (patch) | |
tree | f93b94f3c73bbb46a5bd56416402dc355d05d724 /drivers/block/zram/zram_drv.c | |
parent | block: call rq_qos_done() before ref check in batch completions (diff) | |
download | linux-d422f40163087408b56290156ba233fc5ada53e4.tar.xz linux-d422f40163087408b56290156ba233fc5ada53e4.zip |
zram: only make zram_wb_devops for CONFIG_ZRAM_WRITEBACK
If writeback isn't configured, then we get the following warning when
compiling zram:
drivers/block/zram/zram_drv.c:1824:45: warning: unused variable 'zram_wb_devops' [-Wunused-const-variable]
Make sure we only define the block_device_operations if that option is
enabled.
Link: https://lore.kernel.org/lkml/202111261614.gCJMqcyh-lkp@intel.com/
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r-- | drivers/block/zram/zram_drv.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 08d7953ec5f1..25071126995b 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1853,12 +1853,14 @@ static const struct block_device_operations zram_devops = { .owner = THIS_MODULE }; +#ifdef CONFIG_ZRAM_WRITEBACK static const struct block_device_operations zram_wb_devops = { .open = zram_open, .submit_bio = zram_submit_bio, .swap_slot_free_notify = zram_slot_free_notify, .owner = THIS_MODULE }; +#endif static DEVICE_ATTR_WO(compact); static DEVICE_ATTR_RW(disksize); |