2020-01-20 03:43:07

by Yue Hu

[permalink] [raw]
Subject: [PATCH] zram: move backing_dev under macro CONFIG_ZRAM_WRITEBACK

From: Yue Hu <[email protected]>

backing_dev is never used when not enable CONFIG_ZRAM_WRITEBACK and
it's introduced from writeback feature. So it's needless also affect
readability in that case.

Signed-off-by: Yue Hu <[email protected]>
---
drivers/block/zram/zram_drv.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h
index f2fd46d..1cb3b9a 100644
--- a/drivers/block/zram/zram_drv.h
+++ b/drivers/block/zram/zram_drv.h
@@ -112,8 +112,8 @@ struct zram {
* zram is claimed so open request will be failed
*/
bool claim; /* Protected by bdev->bd_mutex */
- struct file *backing_dev;
#ifdef CONFIG_ZRAM_WRITEBACK
+ struct file *backing_dev;
spinlock_t wb_limit_lock;
bool wb_limit_enable;
u64 bd_wb_limit;
--
1.9.1


2020-01-20 05:32:12

by Sergey Senozhatsky

[permalink] [raw]
Subject: Re: [PATCH] zram: move backing_dev under macro CONFIG_ZRAM_WRITEBACK

On (20/01/20 11:41), Yue Hu wrote:
> backing_dev is never used when not enable CONFIG_ZRAM_WRITEBACK and
> it's introduced from writeback feature. So it's needless also affect
> readability in that case.
>
> Signed-off-by: Yue Hu <[email protected]>

Looks good to me

Reviewed-by: Sergey Senozhatsky <[email protected]>

-ss

2020-01-23 01:56:37

by Minchan Kim

[permalink] [raw]
Subject: Re: [PATCH] zram: move backing_dev under macro CONFIG_ZRAM_WRITEBACK

On Mon, Jan 20, 2020 at 11:41:55AM +0800, Yue Hu wrote:
> From: Yue Hu <[email protected]>
>
> backing_dev is never used when not enable CONFIG_ZRAM_WRITEBACK and
> it's introduced from writeback feature. So it's needless also affect
> readability in that case.
>
> Signed-off-by: Yue Hu <[email protected]>
Acked-by: Minchan Kim <[email protected]>