diff options
author | Roland Dreier <rolandd@cisco.com> | 2005-10-30 16:20:09 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2005-10-31 10:10:33 -0500 |
commit | 3bc12e75b23c0499cc2c0873a5f77494be173761 (patch) | |
tree | ecb02f68e1055343bb45fc38350a8e33c827efc9 /drivers | |
parent | e5b251a24a9cd34a7ef98e361eb94e7ab122a554 (diff) |
[IPoIB] cleanups: fix comment, remove useless variables
Minor cleanups: fix a misleading comment, and get rid of attr_mask
variables that are only used to hold constants (just use the constants
directly).
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ib.c | 12 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_verbs.c | 4 |
2 files changed, 7 insertions, 9 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 192fef884e21..0a6f578f18c8 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
@@ -486,15 +486,16 @@ int ipoib_ib_dev_stop(struct net_device *dev) | |||
486 | { | 486 | { |
487 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 487 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
488 | struct ib_qp_attr qp_attr; | 488 | struct ib_qp_attr qp_attr; |
489 | int attr_mask; | ||
490 | unsigned long begin; | 489 | unsigned long begin; |
491 | struct ipoib_tx_buf *tx_req; | 490 | struct ipoib_tx_buf *tx_req; |
492 | int i; | 491 | int i; |
493 | 492 | ||
494 | /* Kill the existing QP and allocate a new one */ | 493 | /* |
494 | * Move our QP to the error state and then reinitialize in | ||
495 | * when all work requests have completed or have been flushed. | ||
496 | */ | ||
495 | qp_attr.qp_state = IB_QPS_ERR; | 497 | qp_attr.qp_state = IB_QPS_ERR; |
496 | attr_mask = IB_QP_STATE; | 498 | if (ib_modify_qp(priv->qp, &qp_attr, IB_QP_STATE)) |
497 | if (ib_modify_qp(priv->qp, &qp_attr, attr_mask)) | ||
498 | ipoib_warn(priv, "Failed to modify QP to ERROR state\n"); | 499 | ipoib_warn(priv, "Failed to modify QP to ERROR state\n"); |
499 | 500 | ||
500 | /* Wait for all sends and receives to complete */ | 501 | /* Wait for all sends and receives to complete */ |
@@ -541,8 +542,7 @@ int ipoib_ib_dev_stop(struct net_device *dev) | |||
541 | 542 | ||
542 | timeout: | 543 | timeout: |
543 | qp_attr.qp_state = IB_QPS_RESET; | 544 | qp_attr.qp_state = IB_QPS_RESET; |
544 | attr_mask = IB_QP_STATE; | 545 | if (ib_modify_qp(priv->qp, &qp_attr, IB_QP_STATE)) |
545 | if (ib_modify_qp(priv->qp, &qp_attr, attr_mask)) | ||
546 | ipoib_warn(priv, "Failed to modify QP to RESET state\n"); | 546 | ipoib_warn(priv, "Failed to modify QP to RESET state\n"); |
547 | 547 | ||
548 | /* Wait for all AHs to be reaped */ | 548 | /* Wait for all AHs to be reaped */ |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c index b5902a7ec240..e829e10400e3 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c | |||
@@ -41,7 +41,6 @@ int ipoib_mcast_attach(struct net_device *dev, u16 mlid, union ib_gid *mgid) | |||
41 | { | 41 | { |
42 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 42 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
43 | struct ib_qp_attr *qp_attr; | 43 | struct ib_qp_attr *qp_attr; |
44 | int attr_mask; | ||
45 | int ret; | 44 | int ret; |
46 | u16 pkey_index; | 45 | u16 pkey_index; |
47 | 46 | ||
@@ -59,8 +58,7 @@ int ipoib_mcast_attach(struct net_device *dev, u16 mlid, union ib_gid *mgid) | |||
59 | 58 | ||
60 | /* set correct QKey for QP */ | 59 | /* set correct QKey for QP */ |
61 | qp_attr->qkey = priv->qkey; | 60 | qp_attr->qkey = priv->qkey; |
62 | attr_mask = IB_QP_QKEY; | 61 | ret = ib_modify_qp(priv->qp, qp_attr, IB_QP_QKEY); |
63 | ret = ib_modify_qp(priv->qp, qp_attr, attr_mask); | ||
64 | if (ret) { | 62 | if (ret) { |
65 | ipoib_warn(priv, "failed to modify QP, ret = %d\n", ret); | 63 | ipoib_warn(priv, "failed to modify QP, ret = %d\n", ret); |
66 | goto out; | 64 | goto out; |