From: Johannes Weiner <hannes@cmpxchg.org>
To: Ye Liu <ye.liu@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@kernel.org>, Ye Liu <liuye@kylinos.cn>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
Brendan Jackman <brendan.jackman@linux.dev>,
Zi Yan <ziy@nvidia.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/show_mem: fix format string inconsistencies and type mismatches
Date: Thu, 6 Aug 2026 15:52:03 -0400 [thread overview]
Message-ID: <anTl45iGlcBd_4Uc@cmpxchg.org> (raw)
In-Reply-To: <20260805021556.1908807-1-ye.liu@linux.dev>
On Wed, Aug 05, 2026 at 10:15:55AM +0800, Ye Liu wrote:
> From: Ye Liu <liuye@kylinos.cn>
>
> Fix five format string issues in show_free_areas() and __show_mem():
>
> 1-2. reserved_highatomic and free_highatomic: %luKB -> %lukB
> The uppercase "KB" is inconsistent with all other fields in the
> same output block and with /proc/meminfo convention.
>
> 3. local_pcp: %ukB -> %lukB with explicit (unsigned long) cast
> per_cpu_pages.count is int, so K(count) yields int. Using %u
> was a signed/unsigned mismatch. Cast to unsigned long and use
> %lu for consistency with all other K() usages in the file.
>
> 4. total pagecache pages: %ld -> %lu
> global_node_page_state() returns unsigned long. Using %ld is a
> signedness mismatch caught by gcc -Wformat-signedness.
>
> 5. hwpoisoned pages: %lu -> %ld
> atomic_long_read() returns long (signed). Using %lu is a
> signedness mismatch caught by gcc -Wformat-signedness.
>
> Verified with: make KCFLAGS="-Wformat -Wformat-signedness" mm/show_mem.o
>
> Signed-off-by: Ye Liu <liuye@kylinos.cn>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
prev parent reply other threads:[~2026-08-06 19:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 2:15 [PATCH] mm/show_mem: fix format string inconsistencies and type mismatches Ye Liu
2026-08-05 8:05 ` Vlastimil Babka (SUSE)
2026-08-06 19:52 ` Johannes Weiner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=anTl45iGlcBd_4Uc@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=brendan.jackman@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liuye@kylinos.cn \
--cc=mhocko@suse.com \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=ye.liu@linux.dev \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).