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>
This commit is contained in:
parent
6df1a83ba7
commit
9df2b0d40e
1 changed files with 6 additions and 6 deletions
|
@ -111,7 +111,7 @@ static void chd_dec_free_iodata(struct crystalhd_adp *adp,
|
||||||
spin_unlock_irqrestore(&adp->lock, flags);
|
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 size, int set)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
@ -122,9 +122,9 @@ static inline int crystalhd_user_data(unsigned long ud, void *dr,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (set)
|
if (set)
|
||||||
rc = copy_to_user((void *)ud, dr, size);
|
rc = copy_to_user(ud, dr, size);
|
||||||
else
|
else
|
||||||
rc = copy_from_user(dr, (void *)ud, size);
|
rc = copy_from_user(dr, ud, size);
|
||||||
|
|
||||||
if (rc) {
|
if (rc) {
|
||||||
BCMLOG_ERR("Invalid args for command\n");
|
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;
|
io->add_cdata_sz = m_sz;
|
||||||
ua_off = ua + sizeof(io->udata);
|
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) {
|
if (rc) {
|
||||||
BCMLOG_ERR("failed to pull add_cdata sz:%x ua_off:%x\n",
|
BCMLOG_ERR("failed to pull add_cdata sz:%x ua_off:%x\n",
|
||||||
io->add_cdata_sz, (unsigned int)ua_off);
|
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) {
|
if (io->cmd != BCM_IOC_FW_DOWNLOAD) {
|
||||||
ua_off = ua + sizeof(io->udata);
|
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);
|
io->add_cdata_sz, 1);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
BCMLOG_ERR(
|
BCMLOG_ERR(
|
||||||
|
@ -208,7 +208,7 @@ static int chd_dec_proc_user_data(struct crystalhd_adp *adp,
|
||||||
return -EINVAL;
|
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) {
|
if (rc) {
|
||||||
BCMLOG_ERR("failed to %s iodata\n", (set ? "set" : "get"));
|
BCMLOG_ERR("failed to %s iodata\n", (set ? "set" : "get"));
|
||||||
return rc;
|
return rc;
|
||||||
|
|
Loading…
Add table
Reference in a new issue