Staging: rts5139: Fix incorrect type in assignment in rts51x_fop.c
authorMonam Agarwal <monamagarwal123@gmail.com>
Wed, 5 Mar 2014 01:57:44 +0000 (07:27 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 23:23:56 +0000 (15:23 -0800)
This patch fixes following sparse warning in rts51x_fop.c
Warning: incorrect type in assignment

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rts5139/rts51x_fop.c
drivers/staging/rts5139/rts51x_fop.h

index dee7d8af564e3e2492b90e491aa800a7e3823d1c..677d18b3dcd5aad561dd9f81668495216b549f1a 100644 (file)
@@ -93,7 +93,7 @@ static int rts51x_sd_direct_cmnd(struct rts51x_chip *chip,
                }
 
                retval =
-                   copy_to_user((void *)cmnd->buf, (void *)buf, cmnd->buf_len);
+                   copy_to_user(cmnd->buf, (void *)buf, cmnd->buf_len);
                if (retval) {
                        kfree(buf);
                        TRACE_RET(chip, STATUS_NOMEM);
@@ -109,7 +109,7 @@ static int rts51x_sd_direct_cmnd(struct rts51x_chip *chip,
                        TRACE_RET(chip, STATUS_NOMEM);
 
                retval =
-                   copy_from_user((void *)buf, (void *)cmnd->buf,
+                   copy_from_user((void *)buf, cmnd->buf,
                                   cmnd->buf_len);
                if (retval) {
                        kfree(buf);
@@ -154,7 +154,7 @@ static int rts51x_sd_get_rsp(struct rts51x_chip *chip, struct sd_rsp *rsp)
        else
                count = (rsp->rsp_len < 6) ? rsp->rsp_len : 6;
 
-       retval = copy_to_user((void *)rsp->rsp, (void *)sd_card->rsp, count);
+       retval = copy_to_user(rsp->rsp, (void *)sd_card->rsp, count);
        if (retval)
                TRACE_RET(chip, STATUS_NOMEM);
 
@@ -250,7 +250,7 @@ long rts51x_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
        switch (cmd) {
        case RTS5139_IOC_SD_DIRECT:
                retval =
-                   copy_from_user((void *)&cmnd, (void *)arg,
+                   copy_from_user((void *)&cmnd, (void __user *)arg,
                                   sizeof(struct sd_direct_cmnd));
                if (retval) {
                        retval = -ENOMEM;
@@ -265,7 +265,7 @@ long rts51x_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 
        case RTS5139_IOC_SD_GET_RSP:
                retval =
-                   copy_from_user((void *)&rsp, (void *)arg,
+                   copy_from_user(&rsp, (void __user *)arg,
                                   sizeof(struct sd_rsp));
                if (retval) {
                        retval = -ENOMEM;
index eb45acf50d1a7e74911e03486b184fce783698e4..c691ee99720ee1ea74789a12605838fb7fa9317a 100644 (file)
 
 struct sd_direct_cmnd {
        u8 cmnd[12];
-       void *buf;
+       void __user *buf;
        int buf_len;
 };
 
 struct sd_rsp {
-       void *rsp;
+       void __user *rsp;
        int rsp_len;
 };