Re: [PATCH] selftests/mm: mremap_test: fix build warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 11 Jan 2024 13:20:38 +0500 Muhammad Usama Anjum <usama.anjum@xxxxxxxxxxxxx> 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'.





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux