From: Monam Agarwal Date: Wed, 5 Mar 2014 00:43:54 +0000 (+0530) Subject: Staging: crystalhd: Fix different address spaces warning X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9df2b0d40e77a80274b69d3e8567e6b354c4c0c1;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Greg Kroah-Hartman --- 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;