From: Chuck Lever Date: Mon, 14 Apr 2008 16:27:52 +0000 (-0400) Subject: SUNRPC: Use unsigned loop and array index in svc_init_buffer() X-Git-Tag: v2.6.26-rc1~1083^2~2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=0dc220f0815497858db539d27947f3ec83202ace;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: J. Bruce Fields --- diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index bf46186ddf9..d74c2d26953 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -510,8 +510,7 @@ EXPORT_SYMBOL(svc_destroy); static int svc_init_buffer(struct svc_rqst *rqstp, unsigned int size) { - int pages; - int arghi; + unsigned int pages, arghi; pages = size / PAGE_SIZE + 1; /* extra page as we hold both request and reply. * 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; pages--; } - return ! pages; + return pages == 0; } /*