zram: fix 32-bit atomic_long_t print
Subsystems (2)
PATCH 1/1 zram: fix 32-bit atomic_long_t print
From: Arnd Bergmann <[email protected]>
The type used to print &pool_stats.objs_moved is inconsistent with the definition:
drivers/block/zram/zram_drv.c: In function 'mm_stat_show':drivers/block/zram/zram_drv.c:1234:44: error: passing argument 1 of 'atomic64_read' from incompatible pointer type [-Werror=incompatible-pointer-types]
Change the printing code to match.
--- drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/zram/zram_drv.c +1 -1
@@ -1231,7 +1231,7 @@ static ssize_t mm_stat_show(struct device *dev,atomic_long_read (&pool_stats.pages_compacted), (u64 )atomic64_read (&zram->stats.huge_pages), (u64 )atomic64_read (&zram->stats.huge_pages_since), - (u64)atomic64_read(&pool_stats.objs_moved)); + (u64)atomic_long_read(&pool_stats.objs_moved));up_read (&zram->init_lock);return ret;
Signature · 1 line
2.39.2
Quoted 21 lines · On Mon, 27 Feb 2023 09:56:21 +0100 Arnd Bergmann <[email protected]> wrote:
From: Arnd Bergmann <[email protected]>
The type used to print &pool_stats.objs_moved is inconsistent with the definition:
drivers/block/zram/zram_drv.c: In function 'mm_stat_show':drivers/block/zram/zram_drv.c:1234:44: error: passing argument 1 of 'atomic64_read' from incompatible pointer type [-Werror=incompatible-pointer-types]Change the printing code to match.
Fixes b7d89654a988 ("zram: show zsmalloc objs_moved stat in mm_stat")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/block/zram/zram_drv.c +0
-0
drivers/block/zram/zram_drv.c static ssize_t mm_stat_show(struct device *dev, · line 1237
Quoted 8 lines
drivers/block/zram/zram_drv.c +1
-1@@ -1231,7 +1231,7 @@ static ssize_t mm_stat_show(struct device *dev,atomic_long_read (&pool_stats.pages_compacted), (u64 )atomic64_read (&zram->stats.huge_pages), (u64 )atomic64_read (&zram->stats.huge_pages_since), - (u64)atomic64_read(&pool_stats.objs_moved)); + (u64)atomic_long_read(&pool_stats.objs_moved));up_read (&zram->init_lock);return ret;
Thanks. I'm using the slightly different fix from Geert: