lkml.org 
[lkml]   [2005]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] trivial type correction in fs/mpage.c::__mpage_writepages
This patch changes the variable 'i' in
fs/mpage.c::__mpage_writepages from 'unsigned int' to int.
The only use of 'i' is in the for loop, and the array being indexed is
PAGEVEC_SIZE in size (and with PAGEVEC_SIZE being 14, an int is fully
sufficient) and in the loop itself 'i' is being compared to 'nr_pages'
which is defined as 'int' at the top of the function. So, as far as I can
see changing 'i' to int makes sense - it is more than large enough for
what it's used for, it then matches the type it is compared against
exactely and it avoids a signed vs unsigned comparison.

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>

--- linux-2.6.12-rc2-mm3-orig/fs/mpage.c 2005-04-11 21:20:50.000000000 +0200
+++ linux-2.6.12-rc2-mm3/fs/mpage.c 2005-04-24 01:28:53.000000000 +0200
@@ -676,7 +676,7 @@ retry:
(nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
PAGECACHE_TAG_DIRTY,
min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1))) {
- unsigned i;
+ int i;

scanned = 1;
for (i = 0; i < nr_pages; i++) {

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-04-24 01:36    [W:0.031 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site