From: Andrew Morton <akpm@linux-foundation.org>
To: Muhammad Usama Anjum <usama.anjum@collabora.com>
Cc: Shuah Khan <shuah@kernel.org>,
"Joel Fernandes (Google)" <joel@joelfernandes.org>,
Lorenzo Stoakes <lstoakes@gmail.com>,
kernel@collabora.com, linux-mm@kvack.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/mm: mremap_test: fix build warning
Date: Thu, 11 Jan 2024 13:14:05 -0800 [thread overview]
Message-ID: <20240111131405.4b47521fb8884760d712e93d@linux-foundation.org> (raw)
In-Reply-To: <20240111082039.3398848-1-usama.anjum@collabora.com>
On Thu, 11 Jan 2024 13:20:38 +0500 Muhammad Usama Anjum <usama.anjum@collabora.com> wrote:
> Fix following build warning:
> warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long unsigned int’
>
Looks good to me, but... grumble.
`i' is an integer. That's just how it is, Blame Fortran if you like.
Discovering that someone used `i' for an unsigned long long is like
seeing
struct inode *page;
It is surprising, and readers shouldn't be subjected to surprises.
`i' is used in two ways here. Twice to iterate across threshold values
(as a ULL) and once to iterate across dest_preamble_size, which is an
int. It would be better to have two different variables for the two
different uses. Ones with more appropriate names than `i'.
next prev parent reply other threads:[~2024-01-11 21:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-11 8:20 Muhammad Usama Anjum
2024-01-11 21:14 ` Andrew Morton [this message]
2024-01-12 6:50 ` Muhammad Usama Anjum
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=20240111131405.4b47521fb8884760d712e93d@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=joel@joelfernandes.org \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lstoakes@gmail.com \
--cc=shuah@kernel.org \
--cc=usama.anjum@collabora.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