From: Shuah Khan <skhan@linuxfoundation.org>
To: David Binderman <dcb314@hotmail.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"shuah@kernel.org" <shuah@kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: bug report for linux-6.14/tools/testing/selftests/mm/pagemap_ioctl.c
Date: Fri, 28 Mar 2025 17:14:00 -0600 [thread overview]
Message-ID: <341f69ce-2af2-4c13-8144-146f1aa9fb07@linuxfoundation.org> (raw)
In-Reply-To: <AS8PR02MB10217315060BBFDB21F19643E9CA62@AS8PR02MB10217.eurprd02.prod.outlook.com>
On 3/26/25 13:25, David Binderman wrote:
> Hello there,
>
> Static analyser cppcheck says:
>
>> linux-6.14/tools/testing/selftests/mm/pagemap_ioctl.c:1061:11: style: int result is assigned to long long variable. If the variable is long long to avoid loss of information, then you have loss of information. [truncLongCastAssignment]
>> linux-6.14/tools/testing/selftests/mm/pagemap_ioctl.c:1510:11: style: int result is assigned to long long variable. If the variable is long long to avoid loss of information, then you have loss of information. [truncLongCastAssignment]
>> linux-6.14/tools/testing/selftests/mm/pagemap_ioctl.c:1523:11: style: int result is assigned to long long variable. If the variable is long long to avoid loss of information, then you have loss of information. [truncLongCastAssignment]
>> linux-6.14/tools/testing/selftests/mm/pagemap_ioctl.c:247:11: style: int result is assigned to long long variable. If the variable is long long to avoid loss of information, then you have loss of information. [truncLongCastAssignment]
>> linux-6.14/tools/testing/selftests/mm/pagemap_ioctl.c:435:11: style: int result is assigned to long long variable. If the variable is long long to avoid loss of information, then you have loss of information. [truncLongCastAssignment]
>> linux-6.14/tools/testing/selftests/mm/pagemap_ioctl.c:490:11: style: int result is assigned to long long variable. If the variable is long long to avoid loss of information, then you have loss of information. [truncLongCastAssignment]
>
> The source code of the first one is
>
> mem_size = 10 * page_size;
>
> Maybe better code:
>
> mem_size = 10ULL * page_size;
>
> Regards
>
> David Binderman
>
Can you send a patch for us to review?
thanks,
-- Shuah
prev parent reply other threads:[~2025-03-28 23:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 19:25 David Binderman
2025-03-28 23:14 ` Shuah Khan [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=341f69ce-2af2-4c13-8144-146f1aa9fb07@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=dcb314@hotmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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