No need to cast count since it is already ssize_t. No need
to cast payload to const, but need __force instead to avoid
Sparse complaining.

Reported-and-Suggested-by: Dan Carpenter <dan.carpen...@oracle.com>
Signed-off-by: Peng Tao <tao.p...@emc.com>
Signed-off-by: Andreas Dilger <andreas.dil...@intel.com>
---
 .../lustre/lustre/libcfs/kernel_user_comm.c        |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c 
b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c
index 8084ada..d6d3b2e 100644
--- a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c
+++ b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c
@@ -170,8 +170,8 @@ int libcfs_kkuc_msg_put(struct file *filp, void *payload)
 
        fs = get_fs();
        set_fs(KERNEL_DS);
-       while ((ssize_t)count > 0) {
-               rc = vfs_write(filp, (const void __user *)payload,
+       while (count > 0) {
+               rc = vfs_write(filp, (void __force __user *)payload,
                               count, &offset);
                if (rc < 0)
                        break;
-- 
1.7.9.5

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to