Message ID | 20230225121523.3288544-1-geert+renesas@glider.be |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1476389wrd; Sat, 25 Feb 2023 05:10:47 -0800 (PST) X-Google-Smtp-Source: AK7set9epIvyHgbQbg/ot9NYCQyWa8UMULgckstI7MW7pGngrF3FBKMCssuNhoAm0tZnBbJXpAo6 X-Received: by 2002:a17:906:518:b0:8b1:3554:25 with SMTP id j24-20020a170906051800b008b135540025mr24991636eja.61.1677330647673; Sat, 25 Feb 2023 05:10:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677330647; cv=none; d=google.com; s=arc-20160816; b=UwddNfLmVJ7yuZzGgSxGXi1qSpbFuN5upgF0lwY/3BIiPQP6gFB4cSNB+6jWdyIhdG 89lqtPLMqAOsp5jPb4sKQmy9V2SNQcwVGmC+DT6gTKtCXWp60MUOzdaAgYTl3kwKnzxN QA3nFw2BvlgfDQttJvgMepHM7srP1OPmfxiUhazYkTWpwNajQ/7QQM7+5DGWRNnzwFyW ruH6v2oh++tHuFfY8bwsTxT9u0W9mxoxhTQE8wRLEVZ2ypAbUgwmAh7hvpzwb+hr7cWF GG6Ry1K29xyXsIt9JyEgK2tQZBIissHheHjYe+wdR5jNczSGrzX885CdxbXD6q6VyVjM oaxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Z6pAQ7uz0WLLlrPd9mi/t+CySPJOE4PknLsZF6Ay5mc=; b=plML8AZxEZ9yEkYcr9aOIHQ+Ygc/zxjdwITEwAMeO3Iz8H2OeEh2pk/k+sHUrpdU+a z7Dz2Uxm3dgwOB+gneMGJewMqbpbVmNokrCucAuSAP4qvDAjLlei3+nXY96cdNqP2Hu5 S4oOEV5UwLsh9fvuwQxoIsl340FVWr3F+4dCUZKVZXRRsjRQAbGpXg0d9BojNVLg2gkS D0Ik6S0vM1GGZjWdmSAIBIGIHd4fYzVhr1x/LHZ0M4V/gxekoMXQt4dl9bezkA97XX2j 7x5Ux5aG+fiW5XIv8J3yCCuWQHTCg2YTvIMsipX/t1crcZP1lE2unHRG21+p4aYRZ5vy afHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i20-20020a1709063c5400b008dd8491f9f8si2021144ejg.118.2023.02.25.05.10.14; Sat, 25 Feb 2023 05:10:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbjBYMPc (ORCPT <rfc822;guoshuai5156@gmail.com> + 99 others); Sat, 25 Feb 2023 07:15:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjBYMPb (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 25 Feb 2023 07:15:31 -0500 Received: from andre.telenet-ops.be (andre.telenet-ops.be [IPv6:2a02:1800:120:4::f00:15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DBCE16322 for <linux-kernel@vger.kernel.org>; Sat, 25 Feb 2023 04:15:28 -0800 (PST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed50:4d58:64da:92bc:9ef0]) by andre.telenet-ops.be with bizsmtp id RQFP2900D0sc8Fi01QFPkr; Sat, 25 Feb 2023 13:15:24 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from <geert@linux-m68k.org>) id 1pVtS4-00A3bM-9F; Sat, 25 Feb 2023 13:15:23 +0100 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from <geert@linux-m68k.org>) id 1pVtSV-00DnVN-Ac; Sat, 25 Feb 2023 13:15:23 +0100 From: Geert Uytterhoeven <geert+renesas@glider.be> To: Minchan Kim <minchan@kernel.org>, Sergey Senozhatsky <senozhatsky@chromium.org>, Jens Axboe <axboe@kernel.dk>, Andrew Morton <akpm@linux-foundation.org> Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] zram: Use atomic_long_read() to read atomic_long_t Date: Sat, 25 Feb 2023 13:15:23 +0100 Message-Id: <20230225121523.3288544-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758808661585635010?= X-GMAIL-MSGID: =?utf-8?q?1758808661585635010?= |
Series |
zram: Use atomic_long_read() to read atomic_long_t
|
|
Commit Message
Geert Uytterhoeven
Feb. 25, 2023, 12:15 p.m. UTC
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(-)
Comments
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.
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.
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/
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
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;