From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>,
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: Fri, 12 Jan 2024 11:50:33 +0500 [thread overview]
Message-ID: <bfb6f6ac-d29f-4857-aa8c-6b8da9c2f436@collabora.com> (raw)
In-Reply-To: <20240111131405.4b47521fb8884760d712e93d@linux-foundation.org>
On 1/12/24 2:14 AM, Andrew Morton wrote:
> 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.
Didn't know this. Thanks for sharing. I'll send a v2 by using two variables.
> 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'.
>
--
BR,
Muhammad Usama Anjum
prev parent reply other threads:[~2024-01-12 6:50 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
2024-01-12 6:50 ` Muhammad Usama Anjum [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=bfb6f6ac-d29f-4857-aa8c-6b8da9c2f436@collabora.com \
--to=usama.anjum@collabora.com \
--cc=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 \
/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