Commit d422f401 authored by Jens Axboe's avatar Jens Axboe

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: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 98b26a0e
...@@ -1853,12 +1853,14 @@ static const struct block_device_operations zram_devops = { ...@@ -1853,12 +1853,14 @@ static const struct block_device_operations zram_devops = {
.owner = THIS_MODULE .owner = THIS_MODULE
}; };
#ifdef CONFIG_ZRAM_WRITEBACK
static const struct block_device_operations zram_wb_devops = { static const struct block_device_operations zram_wb_devops = {
.open = zram_open, .open = zram_open,
.submit_bio = zram_submit_bio, .submit_bio = zram_submit_bio,
.swap_slot_free_notify = zram_slot_free_notify, .swap_slot_free_notify = zram_slot_free_notify,
.owner = THIS_MODULE .owner = THIS_MODULE
}; };
#endif
static DEVICE_ATTR_WO(compact); static DEVICE_ATTR_WO(compact);
static DEVICE_ATTR_RW(disksize); static DEVICE_ATTR_RW(disksize);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment