diff options
author | Tobin C. Harding <me@tobin.cc> | 2017-04-18 03:35:31 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-04-18 14:33:17 +0300 |
commit | 055da4f9b95dd2a50c653b5a4559b9186081fb75 (patch) | |
tree | 8f91997ee9dd1d14078db7d756721c97ff60e8af /drivers/staging/ks7010/ks_wlan_net.c | |
parent | 68711cebcbb4dd7f5c05245715eefa4f4d4be760 (diff) | |
download | linux-055da4f9b95dd2a50c653b5a4559b9186081fb75.tar.xz |
staging: ks7010: fix complete_handler
complete_handler() takes void * types as parameters. void * parameters are then
cast to struct types. Call sites for this function either pass in NULL
or pointers to the struct types cast to void *. This casting is
unnecessary and can be removed.
Struct tx_device_buffer (which contains a pointer member to the
complete_handler() function) has as member 'ks_wlan_priv *priv' this is
unnecessary, we always have a pointer to this struct there is no need
to store it here.
The complete_handler can be more clearly defined by using struct
pointer types instead of void * types. The code is currently
unnecessarily complex, storing and passing extraneous pointer
parameters.
Remove unnecessary parameters, unnecessary casting to/from 'void
*'. Fix all call sites involving complete_handler().
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ks7010/ks_wlan_net.c')
-rw-r--r-- | drivers/staging/ks7010/ks_wlan_net.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c index a34ff47e4ac9..0ef52c85a50b 100644 --- a/drivers/staging/ks7010/ks_wlan_net.c +++ b/drivers/staging/ks7010/ks_wlan_net.c @@ -2908,11 +2908,8 @@ int ks_wlan_start_xmit(struct sk_buff *skb, struct net_device *dev) return 0; } -void send_packet_complete(void *arg1, void *arg2) +void send_packet_complete(struct ks_wlan_private *priv, struct sk_buff *skb) { - struct ks_wlan_private *priv = (struct ks_wlan_private *)arg1; - struct sk_buff *packet = (struct sk_buff *)arg2; - DPRINTK(3, "\n"); priv->nstats.tx_packets++; @@ -2920,10 +2917,9 @@ void send_packet_complete(void *arg1, void *arg2) if (netif_queue_stopped(priv->net_dev)) netif_wake_queue(priv->net_dev); - if (packet) { - priv->nstats.tx_bytes += packet->len; - dev_kfree_skb(packet); - packet = NULL; + if (skb) { + priv->nstats.tx_bytes += skb->len; + dev_kfree_skb(skb); } } |