Skip to contentSkip to conversation

staging:lustre:lnet: Incorrect type in assignment

PATCH In review sunwxg 2 participants 2 messages Dec 1, 2014 Staging

lore
Share & tools
lore

sunwxg

author
#0 lore raw

PATCH 1/1 staging:lustre:lnet: Incorrect type in assignment

From: Sun Wang <[email protected]>

Incorrect type when assign value to varible iov_base.

---
.../drivers => drivers}/staging/lustre/lnet/lnet/lib-move.c | 3 ++-

 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/lustre/lnet/lnet/lib-move.c +2 -1
index 4b9567d..7b22c6e 100644
@@ -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);
 
 		if (len <= frag_len) {
 			dst->iov_len = len;
#1 lore raw
Quoted 1 line · sunwxg

Incorrect type when assign value to varible iov_base.

[]

drivers/staging/lustre/lnet/lnet/lib-move.c

Quoted 1 line
drivers/staging/lustre/lnet/lnet/lib-move.c +0 -0

[]

drivers/staging/lustre/lnet/lnet/lib-move.c lnet_extract_iov(int dst_niov, struct iovec *dst, · line 260

Quoted 7 lines
drivers/staging/lustre/lnet/lnet/lib-move.c +2 -1
@@ -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;