From f2fd09d3b285117dd8b45f78ab7c9d4c7e05f04f Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 17 Oct 2014 02:22:23 +0000 Subject: [PATCH] scst_vdisk: Remove a superfluous cast The 'iov_base' member of 'struct iovec' is declared in with type 'void __user *'. Adding an integer to a void pointer has the same effect as adding an integer to a char pointer in the C language. This means that it is safe to remove the cast in front of the eiv->iov_base pointer. Please note that a similar construct already exists in the iSCSI target driver. From the nthread.c source file: iop->iov_base += rest; iop->iov_len -= rest; This patch does not change any functionality. Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5847 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 64fa92490..a110e968c 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -5116,8 +5116,7 @@ restart: eiv++; eiv_count--; } else { - eiv->iov_base = - (uint8_t __force __user *)eiv->iov_base + err; + eiv->iov_base += err; eiv->iov_len -= err; break; }