From: Peng Tao Date: Thu, 6 Jun 2013 15:04:07 +0000 (+0800) Subject: staging/lustre/libcfs: cleanup libcfs_kkuc_msg_put a bit X-Git-Tag: v3.11-rc1~158^2~257 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=e543d2eaa8db8cdf14f9d91b6c2469e75d8fc0c0;p=linux.git staging/lustre/libcfs: cleanup libcfs_kkuc_msg_put a bit 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 Signed-off-by: Peng Tao Signed-off-by: Andreas Dilger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c index 8084ada4a6aa..d6d3b2e0f307 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;