SUNRPC: Use unsigned loop and array index in svc_init_buffer()
authorChuck Lever <chuck.lever@oracle.com>
Mon, 14 Apr 2008 16:27:52 +0000 (12:27 -0400)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Wed, 23 Apr 2008 20:13:43 +0000 (16:13 -0400)
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>
net/sunrpc/svc.c

index bf46186ddf9fc016f5b85587c637c3e43e9d69a0..d74c2d269539a03a4267dcc93d195ca20e68d522 100644 (file)
@@ -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;
 }
 
 /*