* [PATCH] zram: Use atomic_long_read() to read atomic_long_t
@ 2023-02-25 12:15 Geert Uytterhoeven
2023-02-26 3:38 ` Sergey Senozhatsky
2023-02-26 4:30 ` Andrew Morton
0 siblings, 2 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2023-02-25 12:15 UTC (permalink / raw)
To: Minchan Kim, Sergey Senozhatsky, Jens Axboe, Andrew Morton
Cc: linux-block, linux-kernel
On 32-bit:
drivers/block/zram/zram_drv.c: In function ‘mm_stat_show’:
drivers/block/zram/zram_drv.c:1234:23: error: passing argument 1 of ‘atomic64_read’ from incompatible pointer type [-Werror=incompatible-pointer-types]
1234 | (u64)atomic64_read(&pool_stats.objs_moved));
| ^~~~~~~~~~~~~~~~~~~~~~
| |
| atomic_long_t * {aka struct <anonymous> *}
In file included from ./include/linux/atomic.h:82,
from ./include/linux/mm_types_task.h:13,
from ./include/linux/mm_types.h:5,
from ./include/linux/buildid.h:5,
from ./include/linux/module.h:14,
from drivers/block/zram/zram_drv.c:18:
./include/linux/atomic/atomic-instrumented.h:644:33: note: expected ‘const atomic64_t *’ {aka ‘const struct <anonymous> *’} but argument is of type ‘atomic_long_t *’ {aka ‘struct <anonymous> *’}
644 | atomic64_read(const atomic64_t *v)
| ~~~~~~~~~~~~~~~~~~^
Fix this by using atomic_long_read() instead.
Reported-by; noreply@ellerman.id.au
Fixes: b7d89654a988a2a4 ("zram: show zsmalloc objs_moved stat in mm_stat")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/block/zram/zram_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 3194e9254c6f3a04..8fff358c9cbace17 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1221,7 +1221,7 @@ static ssize_t mm_stat_show(struct device *dev,
max_used = atomic_long_read(&zram->stats.max_used_pages);
ret = scnprintf(buf, PAGE_SIZE,
- "%8llu %8llu %8llu %8lu %8ld %8llu %8lu %8llu %8llu %8llu\n",
+ "%8llu %8llu %8llu %8lu %8ld %8llu %8lu %8llu %8llu %8lu\n",
orig_size << PAGE_SHIFT,
(u64)atomic64_read(&zram->stats.compr_data_size),
mem_used << PAGE_SHIFT,
@@ -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));
+ atomic_long_read(&pool_stats.objs_moved));
up_read(&zram->init_lock);
return ret;
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] zram: Use atomic_long_read() to read atomic_long_t
2023-02-25 12:15 [PATCH] zram: Use atomic_long_read() to read atomic_long_t Geert Uytterhoeven
@ 2023-02-26 3:38 ` Sergey Senozhatsky
2023-02-26 4:30 ` Andrew Morton
1 sibling, 0 replies; 5+ messages in thread
From: Sergey Senozhatsky @ 2023-02-26 3:38 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Minchan Kim, Sergey Senozhatsky, Jens Axboe, Andrew Morton,
linux-block, linux-kernel
On (23/02/25 13:15), Geert Uytterhoeven wrote:
> On 32-bit:
>
> drivers/block/zram/zram_drv.c: In function ‘mm_stat_show’:
> drivers/block/zram/zram_drv.c:1234:23: error: passing argument 1 of ‘atomic64_read’ from incompatible pointer type [-Werror=incompatible-pointer-types]
> 1234 | (u64)atomic64_read(&pool_stats.objs_moved));
> | ^~~~~~~~~~~~~~~~~~~~~~
> | |
> | atomic_long_t * {aka struct <anonymous> *}
> In file included from ./include/linux/atomic.h:82,
> from ./include/linux/mm_types_task.h:13,
> from ./include/linux/mm_types.h:5,
> from ./include/linux/buildid.h:5,
> from ./include/linux/module.h:14,
> from drivers/block/zram/zram_drv.c:18:
> ./include/linux/atomic/atomic-instrumented.h:644:33: note: expected ‘const atomic64_t *’ {aka ‘const struct <anonymous> *’} but argument is of type ‘atomic_long_t *’ {aka ‘struct <anonymous> *’}
> 644 | atomic64_read(const atomic64_t *v)
> | ~~~~~~~~~~~~~~~~~~^
>
> Fix this by using atomic_long_read() instead.
Hi Geert,
The patch that cause the warning probably will be droppped from
the series in v3.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] zram: Use atomic_long_read() to read atomic_long_t
2023-02-25 12:15 [PATCH] zram: Use atomic_long_read() to read atomic_long_t Geert Uytterhoeven
2023-02-26 3:38 ` Sergey Senozhatsky
@ 2023-02-26 4:30 ` Andrew Morton
2023-02-26 4:57 ` Andrew Morton
1 sibling, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2023-02-26 4:30 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Minchan Kim, Sergey Senozhatsky, Jens Axboe, linux-block,
linux-kernel
On Sat, 25 Feb 2023 13:15:23 +0100 Geert Uytterhoeven <geert+renesas@glider.be> wrote:
> On 32-bit:
>
> drivers/block/zram/zram_drv.c: In function ‘mm_stat_show’:
> drivers/block/zram/zram_drv.c:1234:23: error: passing argument 1 of ‘atomic64_read’ from incompatible pointer type [-Werror=incompatible-pointer-types]
> 1234 | (u64)atomic64_read(&pool_stats.objs_moved));
> | ^~~~~~~~~~~~~~~~~~~~~~
> | |
> | atomic_long_t * {aka struct <anonymous> *}
> In file included from ./include/linux/atomic.h:82,
> from ./include/linux/mm_types_task.h:13,
> from ./include/linux/mm_types.h:5,
> from ./include/linux/buildid.h:5,
> from ./include/linux/module.h:14,
> from drivers/block/zram/zram_drv.c:18:
> ./include/linux/atomic/atomic-instrumented.h:644:33: note: expected ‘const atomic64_t *’ {aka ‘const struct <anonymous> *’} but argument is of type ‘atomic_long_t *’ {aka ‘struct <anonymous> *’}
> 644 | atomic64_read(const atomic64_t *v)
> | ~~~~~~~~~~~~~~~~~~^
>
> Fix this by using atomic_long_read() instead.
>
> Reported-by; noreply@ellerman.id.au
That's an interesting one. Was this mpe@?
I like it when a Reported-by: is followed by a Link: to the report, so
I can go hunt down such things.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] zram: Use atomic_long_read() to read atomic_long_t
2023-02-26 4:30 ` Andrew Morton
@ 2023-02-26 4:57 ` Andrew Morton
2023-02-26 9:45 ` Geert Uytterhoeven
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2023-02-26 4:57 UTC (permalink / raw)
To: Andrew Morton
Cc: Geert Uytterhoeven, Minchan Kim, Sergey Senozhatsky, Jens Axboe,
linux-block, linux-kernel
On Sat, 25 Feb 2023 20:30:52 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
> > Fix this by using atomic_long_read() instead.
> >
> > Reported-by; noreply@ellerman.id.au
>
> That's an interesting one. Was this mpe@?
>
> I like it when a Reported-by: is followed by a Link: to the report, so
> I can go hunt down such things.
I found this, and added it to the changelog:
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202302241840.nwdXqE5r-lkp@intel.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] zram: Use atomic_long_read() to read atomic_long_t
2023-02-26 4:57 ` Andrew Morton
@ 2023-02-26 9:45 ` Geert Uytterhoeven
0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2023-02-26 9:45 UTC (permalink / raw)
To: Andrew Morton
Cc: Geert Uytterhoeven, Minchan Kim, Sergey Senozhatsky, Jens Axboe,
linux-block, linux-kernel
Hi Andrew,
On Sun, Feb 26, 2023 at 5:57 AM Andrew Morton <akpm@linux-foundation.org> wrote:
> On Sat, 25 Feb 2023 20:30:52 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
> > > Fix this by using atomic_long_read() instead.
> > >
> > > Reported-by; noreply@ellerman.id.au
> >
> > That's an interesting one. Was this mpe@?
No, from the kisskb build bot, which sends private emails to the
architecture maintainers when one of their builds fail:
----8<-------------------------------------------------------------------------------------------
Subject: kisskb: FAILED linux-next/m68k-defconfig/m68k-gcc8 Sat Feb 25, 14:34
From: noreply@ellerman.id.au
To: geert@linux-m68k.org
Date: Sat, 25 Feb 2023 03:35:59 -0000
Message-ID: <20230225033559.1.93322@37da20578230>
FAILED linux-next/m68k-defconfig/m68k-gcc8 Sat Feb 25, 14:34
http://kisskb.ellerman.id.au/kisskb/buildresult/14885627/
Commit: Add linux-next specific files for 20230225
8232539f864ca60474e38eb42d451f5c26415856
Compiler: m68k-linux-gcc (GCC) 8.5.0 / GNU ld (GNU Binutils) 2.36.1
Possible errors
---------------
drivers/block/zram/zram_drv.c:1234:23: error: passing argument 1 of
'atomic64_read' from incompatible pointer type
[-Werror=incompatible-pointer-types]
cc1: some warnings being treated as errors
make[5]: *** [scripts/Makefile.build:252: drivers/block/zram/zram_drv.o] Error 1
make[4]: *** [scripts/Makefile.build:494: drivers/block/zram] Error 2
make[3]: *** [scripts/Makefile.build:494: drivers/block] Error 2
make[2]: *** [scripts/Makefile.build:494: drivers] Error 2
make[1]: *** [Makefile:2028: .] Error 2
make: *** [Makefile:226: __sub-make] Error 2
Possible warnings (1)
----------------------
include/linux/list.h:74:12: warning: 'seed_devices' may be used
uninitialized in this function [-Wmaybe-uninitialized]
------------------------------------------------------------------------------------------>8-----
> > I like it when a Reported-by: is followed by a Link: to the report, so
> > I can go hunt down such things.
>
> I found this, and added it to the changelog:
>
> Reported-by: kernel test robot <lkp@intel.com>
> Link: https://lore.kernel.org/oe-kbuild-all/202302241840.nwdXqE5r-lkp@intel.com/
That's a different bot ;-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-02-26 9:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-25 12:15 [PATCH] zram: Use atomic_long_read() to read atomic_long_t Geert Uytterhoeven
2023-02-26 3:38 ` Sergey Senozhatsky
2023-02-26 4:30 ` Andrew Morton
2023-02-26 4:57 ` Andrew Morton
2023-02-26 9:45 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).