Re: [PATCH 09/24] SUNRPC: Use unsigned index when looping over arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 14, 2008 at 12:27:45PM -0400, Chuck Lever wrote:
> Clean up: Suppress a harmless compiler warning in the RPC server related
> to array indices.
> 
> ARRAY_SIZE() returns a size_t, so use unsigned type for a loop index when
> looping over arrays.

OK (and thanks for the "harmless compiler warning clarification").--b.

> 
> Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
> ---
> 
>  net/sunrpc/svc.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
> index a290e15..c1e763b 100644
> --- a/net/sunrpc/svc.c
> +++ b/net/sunrpc/svc.c
> @@ -528,8 +528,9 @@ svc_init_buffer(struct svc_rqst *rqstp, unsigned int size)
>  static void
>  svc_release_buffer(struct svc_rqst *rqstp)
>  {
> -	int i;
> -	for (i=0; i<ARRAY_SIZE(rqstp->rq_pages); i++)
> +	unsigned int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(rqstp->rq_pages); i++)
>  		if (rqstp->rq_pages[i])
>  			put_page(rqstp->rq_pages[i]);
>  }
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux