From 8155f3681549fd590fa1acff4d6c2edd35958c79 Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Fri, 2 Sep 2011 16:00:30 +0200 Subject: [PATCH] staging: brcm80211: use address space qualifier in brcmfmac Several sparse warning were issued due to missing __user qualifier for brcmfmac variables. This patch adds those. Reported-by: Aaro Koskinen Reviewed-by: Franky (Zhenhui) Lin Reviewed-by: Roland Vossen Signed-off-by: Roland Vossen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/brcm80211/brcmfmac/dhd.h | 2 +- drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 4 ++-- drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h index ee09c17db58d..4d06d874e171 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd.h +++ b/drivers/staging/brcm80211/brcmfmac/dhd.h @@ -779,7 +779,7 @@ extern void brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, /* Linux network driver ioctl encoding */ struct brcmf_c_ioctl { uint cmd; /* common ioctl definition */ - void *buf; /* pointer to user buffer */ + void __user *buf; /* pointer to user buffer */ uint len; /* length of user buffer */ bool set; /* get or set request (optional) */ uint used; /* bytes read or written (optional) */ diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c index 470759a1f101..bb0f71866a6a 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c @@ -835,7 +835,7 @@ static struct ethtool_ops brcmf_ethtool_ops = { .get_drvinfo = brcmf_ethtool_get_drvinfo }; -static int brcmf_ethtool(struct brcmf_info *drvr_priv, void *uaddr) +static int brcmf_ethtool(struct brcmf_info *drvr_priv, void __user *uaddr) { struct ethtool_drvinfo info; char drvname[sizeof(info.driver)]; @@ -1001,7 +1001,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr, } /* To differentiate read 4 more byes */ - if ((copy_from_user(&driver, (char *)ifr->ifr_data + + if ((copy_from_user(&driver, (char __user *)ifr->ifr_data + sizeof(struct brcmf_ioctl), sizeof(uint)) != 0)) { bcmerror = -EINVAL; goto done; diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c index 60a04b37a3d2..db51c466f2e5 100644 --- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c @@ -540,7 +540,7 @@ brcmf_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len) ioc.buf = arg; ioc.len = len; strcpy(ifr.ifr_name, dev->name); - ifr.ifr_data = (caddr_t)&ioc; + ifr.ifr_data = (char __user *)&ioc; fs = get_fs(); set_fs(get_ds()); -- 2.30.2