Skip to content

Commit

Permalink
SUNRPC: Use unsigned loop and array index in svc_init_buffer()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chuck Lever authored and J. Bruce Fields committed Apr 23, 2008
1 parent 50c8bb1 commit 0dc220f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/sunrpc/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}

/*
Expand Down

0 comments on commit 0dc220f

Please sign in to comment.