diff mbox series

zram: fix unused 'zram_wb_devops' warning

Message ID 20220608072534.68850-1-wangkefeng.wang@huawei.com (mailing list archive)
State New, archived
Headers show
Series zram: fix unused 'zram_wb_devops' warning | expand

Commit Message

Kefeng Wang June 8, 2022, 7:25 a.m. UTC
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.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 drivers/block/zram/zram_drv.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Kefeng Wang July 12, 2022, 2:17 p.m. UTC | #1
+mm,  kindly ping...

On 2022/6/8 15:25, Kefeng Wang wrote:
> 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.
>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>   drivers/block/zram/zram_drv.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index 39cd1397ed3b..fff5eb4d3f20 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,
Sergey Senozhatsky July 12, 2022, 2:33 p.m. UTC | #2
+ Andrew

Message ID: 20220608072534.68850-1-wangkefeng.wang@huawei.com

On (22/06/08 15:25), Kefeng Wang wrote:
> 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.
> 
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>  drivers/block/zram/zram_drv.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index 39cd1397ed3b..fff5eb4d3f20 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,

Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
diff mbox series

Patch

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 39cd1397ed3b..fff5eb4d3f20 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,