[PATCH] staging:lustre:lnet: Incorrect type in assignment

Joe Perches joe at perches.com
Mon Dec 1 06:33:14 UTC 2014


On Mon, 2014-12-01 at 14:18 +0800, sunwxg wrote:
> Incorrect type when assign value to varible iov_base.
[]
> diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
[]
> @@ -256,7 +256,8 @@ lnet_extract_iov(int dst_niov, struct iovec *dst,
>  		LASSERT((int)niov <= dst_niov);
>  
>  		frag_len = src->iov_len - offset;
> -		dst->iov_base = ((char *)src->iov_base) + offset;
> +		dst->iov_base = (void __user *)
> +				(((char *)src->iov_base) + offset);

Just use void * arithmetic and remove the cast

		dst->iov_base = src->iov_base + offset;




More information about the devel mailing list