Skip to content

Commit 5c37077

Browse files
Zhu Yanjundledford
authored andcommitted
IB/ipoib: Remove the unnecessary error check
The function ipoib_mcast_start_thread/ipoib_ib_dev_up always return zero. As such, in the function ipoib_open, err_stop will never be reached. So remove this err_stop and change the return type of the function ipoib_mcast_start_thread/ipoib_ib_dev_up to void. Signed-off-by: Zhu Yanjun <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 3f9fade commit 5c37077

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

drivers/infiniband/ulp/ipoib/ipoib.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ void ipoib_pkey_event(struct work_struct *work);
500500
void ipoib_ib_dev_cleanup(struct net_device *dev);
501501

502502
int ipoib_ib_dev_open(struct net_device *dev);
503-
int ipoib_ib_dev_up(struct net_device *dev);
503+
void ipoib_ib_dev_up(struct net_device *dev);
504504
void ipoib_ib_dev_down(struct net_device *dev);
505505
void ipoib_ib_dev_stop(struct net_device *dev);
506506
void ipoib_pkey_dev_check_presence(struct net_device *dev);
@@ -513,7 +513,7 @@ void ipoib_mcast_carrier_on_task(struct work_struct *work);
513513
void ipoib_mcast_send(struct net_device *dev, u8 *daddr, struct sk_buff *skb);
514514

515515
void ipoib_mcast_restart_task(struct work_struct *work);
516-
int ipoib_mcast_start_thread(struct net_device *dev);
516+
void ipoib_mcast_start_thread(struct net_device *dev);
517517
int ipoib_mcast_stop_thread(struct net_device *dev);
518518

519519
void ipoib_mcast_dev_down(struct net_device *dev);

drivers/infiniband/ulp/ipoib/ipoib_ib.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -755,20 +755,20 @@ void ipoib_pkey_dev_check_presence(struct net_device *dev)
755755
set_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);
756756
}
757757

758-
int ipoib_ib_dev_up(struct net_device *dev)
758+
void ipoib_ib_dev_up(struct net_device *dev)
759759
{
760760
struct ipoib_dev_priv *priv = netdev_priv(dev);
761761

762762
ipoib_pkey_dev_check_presence(dev);
763763

764764
if (!test_bit(IPOIB_PKEY_ASSIGNED, &priv->flags)) {
765765
ipoib_dbg(priv, "PKEY is not assigned.\n");
766-
return 0;
766+
return;
767767
}
768768

769769
set_bit(IPOIB_FLAG_OPER_UP, &priv->flags);
770770

771-
return ipoib_mcast_start_thread(dev);
771+
ipoib_mcast_start_thread(dev);
772772
}
773773

774774
void ipoib_ib_dev_down(struct net_device *dev)

drivers/infiniband/ulp/ipoib/ipoib_main.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ int ipoib_open(struct net_device *dev)
126126
goto err_disable;
127127
}
128128

129-
if (ipoib_ib_dev_up(dev))
130-
goto err_stop;
129+
ipoib_ib_dev_up(dev);
131130

132131
if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) {
133132
struct ipoib_dev_priv *cpriv;
@@ -150,9 +149,6 @@ int ipoib_open(struct net_device *dev)
150149

151150
return 0;
152151

153-
err_stop:
154-
ipoib_ib_dev_stop(dev);
155-
156152
err_disable:
157153
clear_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags);
158154

drivers/infiniband/ulp/ipoib/ipoib_multicast.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ void ipoib_mcast_join_task(struct work_struct *work)
676676
spin_unlock_irq(&priv->lock);
677677
}
678678

679-
int ipoib_mcast_start_thread(struct net_device *dev)
679+
void ipoib_mcast_start_thread(struct net_device *dev)
680680
{
681681
struct ipoib_dev_priv *priv = netdev_priv(dev);
682682
unsigned long flags;
@@ -686,8 +686,6 @@ int ipoib_mcast_start_thread(struct net_device *dev)
686686
spin_lock_irqsave(&priv->lock, flags);
687687
__ipoib_mcast_schedule_join_thread(priv, NULL, 0);
688688
spin_unlock_irqrestore(&priv->lock, flags);
689-
690-
return 0;
691689
}
692690

693691
int ipoib_mcast_stop_thread(struct net_device *dev)

0 commit comments

Comments
 (0)