diff options
author | Malcolm Priestley <tvboxspy@gmail.com> | 2014-01-13 11:21:09 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-13 18:43:24 -0500 |
commit | 86a362f16079d435a08d27f92ac2bee4e12856f1 (patch) | |
tree | 6868a9c184b66ead92b38f5a83dfb54bf0cbab62 | |
parent | d820fa95fe0416a1a95adfc25c158367cdbd865f (diff) |
staging: vt6656: sparse fixes ethtool_ioctl Use struct ifreq *
Replace useraddr with direct point to struct ifreq->ifr_data
sparse warnings
main_usb.c:1443:44: warning: cast removes address space of expression
main_usb.c:1454:37: warning: incorrect type in argument 2 (different address spaces)
main_usb.c:1454:37: expected void const [noderef] <asn:1>*from
main_usb.c:1454:37: got void *useraddr
main_usb.c:1462:34: warning: incorrect type in argument 1 (different address spaces)
main_usb.c:1462:34: expected void [noderef] <asn:1>*to
main_usb.c:1462:34: got void *useraddr
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/vt6656/main_usb.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index 4cb7aa737a99..58edcae74efc 100644 --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c | |||
@@ -219,7 +219,7 @@ static bool device_init_defrag_cb(struct vnt_private *pDevice); | |||
219 | static void device_init_diversity_timer(struct vnt_private *pDevice); | 219 | static void device_init_diversity_timer(struct vnt_private *pDevice); |
220 | static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev); | 220 | static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev); |
221 | 221 | ||
222 | static int ethtool_ioctl(struct net_device *dev, void *useraddr); | 222 | static int ethtool_ioctl(struct net_device *dev, struct ifreq *); |
223 | static void device_free_tx_bufs(struct vnt_private *pDevice); | 223 | static void device_free_tx_bufs(struct vnt_private *pDevice); |
224 | static void device_free_rx_bufs(struct vnt_private *pDevice); | 224 | static void device_free_rx_bufs(struct vnt_private *pDevice); |
225 | static void device_free_int_bufs(struct vnt_private *pDevice); | 225 | static void device_free_int_bufs(struct vnt_private *pDevice); |
@@ -1439,18 +1439,18 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
1439 | break; | 1439 | break; |
1440 | 1440 | ||
1441 | case SIOCETHTOOL: | 1441 | case SIOCETHTOOL: |
1442 | return ethtool_ioctl(dev, (void *) rq->ifr_data); | 1442 | return ethtool_ioctl(dev, rq); |
1443 | 1443 | ||
1444 | } | 1444 | } |
1445 | 1445 | ||
1446 | return rc; | 1446 | return rc; |
1447 | } | 1447 | } |
1448 | 1448 | ||
1449 | static int ethtool_ioctl(struct net_device *dev, void *useraddr) | 1449 | static int ethtool_ioctl(struct net_device *dev, struct ifreq *rq) |
1450 | { | 1450 | { |
1451 | u32 ethcmd; | 1451 | u32 ethcmd; |
1452 | 1452 | ||
1453 | if (copy_from_user(ðcmd, useraddr, sizeof(ethcmd))) | 1453 | if (copy_from_user(ðcmd, rq->ifr_data, sizeof(ethcmd))) |
1454 | return -EFAULT; | 1454 | return -EFAULT; |
1455 | 1455 | ||
1456 | switch (ethcmd) { | 1456 | switch (ethcmd) { |
@@ -1458,7 +1458,7 @@ static int ethtool_ioctl(struct net_device *dev, void *useraddr) | |||
1458 | struct ethtool_drvinfo info = {ETHTOOL_GDRVINFO}; | 1458 | struct ethtool_drvinfo info = {ETHTOOL_GDRVINFO}; |
1459 | strncpy(info.driver, DEVICE_NAME, sizeof(info.driver)-1); | 1459 | strncpy(info.driver, DEVICE_NAME, sizeof(info.driver)-1); |
1460 | strncpy(info.version, DEVICE_VERSION, sizeof(info.version)-1); | 1460 | strncpy(info.version, DEVICE_VERSION, sizeof(info.version)-1); |
1461 | if (copy_to_user(useraddr, &info, sizeof(info))) | 1461 | if (copy_to_user(rq->ifr_data, &info, sizeof(info))) |
1462 | return -EFAULT; | 1462 | return -EFAULT; |
1463 | return 0; | 1463 | return 0; |
1464 | } | 1464 | } |