From: Kefeng Wang Date: Wed, 8 Jun 2022 07:25:34 +0000 (+0800) Subject: zram: fix unused 'zram_wb_devops' warning X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=13c1c74af7643f27273cb31a412811b8cd971b78;p=linux.git zram: fix unused 'zram_wb_devops' warning drivers/block/zram/zram_drv.c:55:45: warning: 'zram_wb_devops' defined but not used [-Wunused-const-variable=] Fix the above warning if CONFIG_ZRAM_WRITEBACK not enabled. Link: https://lkml.kernel.org/r/20220608072534.68850-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Reviewed-by: Sergey Senozhatsky Cc: Minchan Kim Cc: Nitin Gupta Cc: Jens Axboe Signed-off-by: Andrew Morton --- diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index b8549c61ff2ce..3e281a193feb3 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -52,7 +52,9 @@ static unsigned int num_devices = 1; static size_t huge_class_size; static const struct block_device_operations zram_devops; +#ifdef CONFIG_ZRAM_WRITEBACK static const struct block_device_operations zram_wb_devops; +#endif static void zram_free_page(struct zram *zram, size_t index); static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,