Re: [PATCH 4/4] sunrpc: simplify xdr_shrijk_pagelen use of "copy"

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

 



On Wed, 2010-08-18 at 23:43 +0300, Benny Halevy wrote:
> The "copy" variable value can be computed using the existing
> logic rather than repeating it.
> 
> Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx>
> ---
>  net/sunrpc/xdr.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
> index 42a7ebf..2ab59c3 100644
> --- a/net/sunrpc/xdr.c
> +++ b/net/sunrpc/xdr.c
> @@ -402,14 +402,14 @@ xdr_shrink_pagelen(struct xdr_buf *buf, size_t len)
>  
>  	/* Shift the tail first */
>  	if (tail->iov_len != 0) {
> +		copy = len;
>  		if (tail->iov_len > len) {
>  			char *p = (char *)tail->iov_base + len;
>  			memmove(p, tail->iov_base, tail->iov_len - len);
> +		} else {
> +			copy = tail->iov_len;
>  		}
                 ^^^ We don't need a C block for the 'else' case.

>  		/* Copy from the inlined pages into the tail */
> -		copy = len;
> -		if (copy > tail->iov_len)
> -			copy = tail->iov_len;
>  		_copy_from_pages((char *)tail->iov_base,
>  				buf->pages, buf->page_base + pglen - len,
>  				copy);


--
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