Thread (2 messages) 2 messages, 2 authors, 2023-02-27

Re: [PATCH] zram: fix 32-bit atomic_long_t print

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2023-02-27 22:19:25
Also in: lkml

On Mon, 27 Feb 2023 09:56:21 +0100 Arnd Bergmann [off-list ref] wrote:
quoted hunk ↗ jump to hunk
From: Arnd Bergmann <arnd@arndb.de>

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 <arnd@arndb.de>
---
 drivers/block/zram/zram_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 3194e9254c6f..5c4ac0d3e850 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -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:

https://lkml.kernel.org/r/20230225121523.3288544-1-geert+renesas@glider.be
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help