SUNRPC: Use unsigned loop and array index in svc_init_buffer()

Clean up: Suppress a harmless compiler warning.

Index rq_pages[] with an unsigned type.  Make "pages" unsigned as well,
as it never represents a value less than zero.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
This commit is contained in:
Chuck Lever 2008-04-14 12:27:52 -04:00 коммит произвёл J. Bruce Fields
Родитель 50c8bb13ea
Коммит 0dc220f081
1 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -510,8 +510,7 @@ EXPORT_SYMBOL(svc_destroy);
static int static int
svc_init_buffer(struct svc_rqst *rqstp, unsigned int size) svc_init_buffer(struct svc_rqst *rqstp, unsigned int size)
{ {
int pages; unsigned int pages, arghi;
int arghi;
pages = size / PAGE_SIZE + 1; /* extra page as we hold both request and reply. pages = size / PAGE_SIZE + 1; /* extra page as we hold both request and reply.
* We assume one is at most one page * We assume one is at most one page
@ -525,7 +524,7 @@ svc_init_buffer(struct svc_rqst *rqstp, unsigned int size)
rqstp->rq_pages[arghi++] = p; rqstp->rq_pages[arghi++] = p;
pages--; pages--;
} }
return ! pages; return pages == 0;
} }
/* /*