[PATCH] trivial little type correction in mm/filemap.c::wait_on_page_writeback_range

From: Jesper Juhl
Date: Sat Apr 23 2005 - 17:43:24 EST


This patch changes the variable 'i' in
mm/filemap.c::wait_on_page_writeback_range 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@xxxxxx>
---

mm/filemap.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.12-rc2-mm3-orig/mm/filemap.c 2005-04-11 21:20:56.000000000 +0200
+++ linux-2.6.12-rc2-mm3/mm/filemap.c 2005-04-24 00:36:18.000000000 +0200
@@ -234,7 +234,7 @@ static int wait_on_page_writeback_range(
(nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
PAGECACHE_TAG_WRITEBACK,
min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1)) != 0) {
- unsigned i;
+ int i;

for (i = 0; i < nr_pages; i++) {
struct page *page = pvec.pages[i];



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