[PATCH 2/2] staging/lustre/libcfs: cleanup libcfs_kkuc_msg_put a bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.carpenter@xxxxxxxxxx>
Signed-off-by: Peng Tao <tao.peng@xxxxxxx>
Signed-off-by: Andreas Dilger <andreas.dilger@xxxxxxxxx>
---
 .../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@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux