diff options
author | Monam Agarwal <monamagarwal123@gmail.com> | 2014-03-05 06:13:54 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-07 15:16:26 -0800 |
commit | 9df2b0d40e77a80274b69d3e8567e6b354c4c0c1 (patch) | |
tree | 46dc6960b36ae621213e1bd1097ecaa54e5f0ea3 /drivers/staging | |
parent | 6df1a83ba75d71024e489b67584d298b24305fcf (diff) | |
download | blackbird-obmc-linux-9df2b0d40e77a80274b69d3e8567e6b354c4c0c1.tar.gz blackbird-obmc-linux-9df2b0d40e77a80274b69d3e8567e6b354c4c0c1.zip |
Staging: crystalhd: Fix different address spaces warning
This patch fixes following sparse warning in crystalhd_lnx.c
WARNING: incorrect type in argument
Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/crystalhd/crystalhd_lnx.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c index 99eefd0291c3..c561feddb0df 100644 --- a/drivers/staging/crystalhd/crystalhd_lnx.c +++ b/drivers/staging/crystalhd/crystalhd_lnx.c @@ -111,7 +111,7 @@ static void chd_dec_free_iodata(struct crystalhd_adp *adp, spin_unlock_irqrestore(&adp->lock, flags); } -static inline int crystalhd_user_data(unsigned long ud, void *dr, +static inline int crystalhd_user_data(void __user *ud, void *dr, int size, int set) { int rc; @@ -122,9 +122,9 @@ static inline int crystalhd_user_data(unsigned long ud, void *dr, } if (set) - rc = copy_to_user((void *)ud, dr, size); + rc = copy_to_user(ud, dr, size); else - rc = copy_from_user(dr, (void *)ud, size); + rc = copy_from_user(dr, ud, size); if (rc) { BCMLOG_ERR("Invalid args for command\n"); @@ -153,7 +153,7 @@ static int chd_dec_fetch_cdata(struct crystalhd_adp *adp, io->add_cdata_sz = m_sz; ua_off = ua + sizeof(io->udata); - rc = crystalhd_user_data(ua_off, io->add_cdata, io->add_cdata_sz, 0); + rc = crystalhd_user_data((void __user *)ua_off, io->add_cdata, io->add_cdata_sz, 0); if (rc) { BCMLOG_ERR("failed to pull add_cdata sz:%x ua_off:%x\n", io->add_cdata_sz, (unsigned int)ua_off); @@ -178,7 +178,7 @@ static int chd_dec_release_cdata(struct crystalhd_adp *adp, if (io->cmd != BCM_IOC_FW_DOWNLOAD) { ua_off = ua + sizeof(io->udata); - rc = crystalhd_user_data(ua_off, io->add_cdata, + rc = crystalhd_user_data((void __user *)ua_off, io->add_cdata, io->add_cdata_sz, 1); if (rc) { BCMLOG_ERR( @@ -208,7 +208,7 @@ static int chd_dec_proc_user_data(struct crystalhd_adp *adp, return -EINVAL; } - rc = crystalhd_user_data(ua, &io->udata, sizeof(io->udata), set); + rc = crystalhd_user_data((void __user *)ua, &io->udata, sizeof(io->udata), set); if (rc) { BCMLOG_ERR("failed to %s iodata\n", (set ? "set" : "get")); return rc; |