mirror of https://gitee.com/openkylin/linux.git
n_gsm: Drop unneeded cast on netdev_priv
The result of netdev_priv is already implicitly cast to the type of the left side of the assignment. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ type T; T *x; @@ x = - (T *) netdev_priv(...) // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f0e381158a
commit
5dbc32a88f
|
@ -2669,7 +2669,7 @@ static inline void muxnet_put(struct gsm_mux_net *mux_net)
|
||||||
static int gsm_mux_net_start_xmit(struct sk_buff *skb,
|
static int gsm_mux_net_start_xmit(struct sk_buff *skb,
|
||||||
struct net_device *net)
|
struct net_device *net)
|
||||||
{
|
{
|
||||||
struct gsm_mux_net *mux_net = (struct gsm_mux_net *)netdev_priv(net);
|
struct gsm_mux_net *mux_net = netdev_priv(net);
|
||||||
struct gsm_dlci *dlci = mux_net->dlci;
|
struct gsm_dlci *dlci = mux_net->dlci;
|
||||||
muxnet_get(mux_net);
|
muxnet_get(mux_net);
|
||||||
|
|
||||||
|
@ -2698,7 +2698,7 @@ static void gsm_mux_rx_netchar(struct gsm_dlci *dlci,
|
||||||
{
|
{
|
||||||
struct net_device *net = dlci->net;
|
struct net_device *net = dlci->net;
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
struct gsm_mux_net *mux_net = (struct gsm_mux_net *)netdev_priv(net);
|
struct gsm_mux_net *mux_net = netdev_priv(net);
|
||||||
muxnet_get(mux_net);
|
muxnet_get(mux_net);
|
||||||
|
|
||||||
/* Allocate an sk_buff */
|
/* Allocate an sk_buff */
|
||||||
|
@ -2727,7 +2727,7 @@ static void gsm_mux_rx_netchar(struct gsm_dlci *dlci,
|
||||||
|
|
||||||
static int gsm_change_mtu(struct net_device *net, int new_mtu)
|
static int gsm_change_mtu(struct net_device *net, int new_mtu)
|
||||||
{
|
{
|
||||||
struct gsm_mux_net *mux_net = (struct gsm_mux_net *)netdev_priv(net);
|
struct gsm_mux_net *mux_net = netdev_priv(net);
|
||||||
if ((new_mtu < 8) || (new_mtu > mux_net->dlci->gsm->mtu))
|
if ((new_mtu < 8) || (new_mtu > mux_net->dlci->gsm->mtu))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
net->mtu = new_mtu;
|
net->mtu = new_mtu;
|
||||||
|
@ -2763,7 +2763,7 @@ static void gsm_destroy_network(struct gsm_dlci *dlci)
|
||||||
pr_debug("destroy network interface");
|
pr_debug("destroy network interface");
|
||||||
if (!dlci->net)
|
if (!dlci->net)
|
||||||
return;
|
return;
|
||||||
mux_net = (struct gsm_mux_net *)netdev_priv(dlci->net);
|
mux_net = netdev_priv(dlci->net);
|
||||||
muxnet_put(mux_net);
|
muxnet_put(mux_net);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2801,7 +2801,7 @@ static int gsm_create_network(struct gsm_dlci *dlci, struct gsm_netconfig *nc)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
net->mtu = dlci->gsm->mtu;
|
net->mtu = dlci->gsm->mtu;
|
||||||
mux_net = (struct gsm_mux_net *)netdev_priv(net);
|
mux_net = netdev_priv(net);
|
||||||
mux_net->dlci = dlci;
|
mux_net->dlci = dlci;
|
||||||
kref_init(&mux_net->ref);
|
kref_init(&mux_net->ref);
|
||||||
strncpy(nc->if_name, net->name, IFNAMSIZ); /* return net name */
|
strncpy(nc->if_name, net->name, IFNAMSIZ); /* return net name */
|
||||||
|
|
Loading…
Reference in New Issue