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 <[email protected]>
--- 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++) {