lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bfb6f6ac-d29f-4857-aa8c-6b8da9c2f436@collabora.com>
Date: Fri, 12 Jan 2024 11:50:33 +0500
From: Muhammad Usama Anjum <usama.anjum@...labora.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Muhammad Usama Anjum <usama.anjum@...labora.com>,
 Shuah Khan <shuah@...nel.org>,
 "Joel Fernandes (Google)" <joel@...lfernandes.org>,
 Lorenzo Stoakes <lstoakes@...il.com>, kernel@...labora.com,
 linux-mm@...ck.org, linux-kselftest@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] selftests/mm: mremap_test: fix build warning

On 1/12/24 2:14 AM, Andrew Morton wrote:
> On Thu, 11 Jan 2024 13:20:38 +0500 Muhammad Usama Anjum <usama.anjum@...labora.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ