diff options
author | Andrey Shvetsov <andrey.shvetsov@k2l.de> | 2017-05-12 13:59:49 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-15 12:59:08 +0300 |
commit | a73470f202ea8b39b70d802b973b8d4429b9ed4d (patch) | |
tree | 402f8491021228ccec0d31df3360c6d82bc15f75 /drivers/staging/most | |
parent | e06c1f6b4fff266f55ebd0a88992f9872a5779c3 (diff) | |
download | linux-a73470f202ea8b39b70d802b973b8d4429b9ed4d.tar.xz |
staging: most: net: remove useless variable channels_opened
The function most_nd_stop is only called by successful return from the
function most_nd_open, so the channels_opened is always true in the
function most_nd_stop.
The functions aim_resume_tx_channel and aim_rx_data are only called
after successful most_start_channel in the function most_nd_open, so the
channels_opened is always true in the functions aim_resume_tx_channel
and aim_rx_data.
Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most')
-rw-r--r-- | drivers/staging/most/aim-network/networking.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/staging/most/aim-network/networking.c b/drivers/staging/most/aim-network/networking.c index ce1764cba5f0..004dd7b636cd 100644 --- a/drivers/staging/most/aim-network/networking.c +++ b/drivers/staging/most/aim-network/networking.c @@ -65,7 +65,6 @@ struct net_dev_channel { struct net_dev_context { struct most_interface *iface; - bool channels_opened; bool is_mamac; struct net_device *dev; struct net_dev_channel rx; @@ -187,9 +186,6 @@ static int most_nd_open(struct net_device *dev) BUG_ON(nd->dev != dev); - if (nd->channels_opened) - return -EFAULT; - BUG_ON(!nd->tx.linked || !nd->rx.linked); if (most_start_channel(nd->iface, nd->rx.ch_id, &aim)) { @@ -219,7 +215,6 @@ static int most_nd_open(struct net_device *dev) } } - nd->channels_opened = true; netif_wake_queue(dev); return 0; @@ -237,12 +232,8 @@ static int most_nd_stop(struct net_device *dev) BUG_ON(nd->dev != dev); netif_stop_queue(dev); - - if (nd->channels_opened) { - most_stop_channel(nd->iface, nd->rx.ch_id, &aim); - most_stop_channel(nd->iface, nd->tx.ch_id, &aim); - nd->channels_opened = false; - } + most_stop_channel(nd->iface, nd->rx.ch_id, &aim); + most_stop_channel(nd->iface, nd->tx.ch_id, &aim); return 0; } @@ -431,7 +422,7 @@ static int aim_resume_tx_channel(struct most_interface *iface, struct net_dev_context *nd; nd = get_net_dev_context(iface); - if (!nd || !nd->channels_opened || nd->tx.ch_id != channel_idx) + if (!nd || nd->tx.ch_id != channel_idx) return 0; if (!nd->dev) @@ -452,7 +443,7 @@ static int aim_rx_data(struct mbo *mbo) unsigned int skb_len; nd = get_net_dev_context(mbo->ifp); - if (!nd || !nd->channels_opened || nd->rx.ch_id != mbo->hdm_channel_id) + if (!nd || nd->rx.ch_id != mbo->hdm_channel_id) return -EIO; dev = nd->dev; |