Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3bc12e75 authored by Roland Dreier's avatar Roland Dreier
Browse files

[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: default avatarRoland Dreier <rolandd@cisco.com>
parent e5b251a2
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -486,15 +486,16 @@ int ipoib_ib_dev_stop(struct net_device *dev)
{
	struct ipoib_dev_priv *priv = netdev_priv(dev);
	struct ib_qp_attr qp_attr;
	int attr_mask;
	unsigned long begin;
	struct ipoib_tx_buf *tx_req;
	int i;

	/* Kill the existing QP and allocate a new one */
	/*
	 * Move our QP to the error state and then reinitialize in
	 * when all work requests have completed or have been flushed.
	 */
	qp_attr.qp_state = IB_QPS_ERR;
	attr_mask        = IB_QP_STATE;
	if (ib_modify_qp(priv->qp, &qp_attr, attr_mask))
	if (ib_modify_qp(priv->qp, &qp_attr, IB_QP_STATE))
		ipoib_warn(priv, "Failed to modify QP to ERROR state\n");

	/* Wait for all sends and receives to complete */
@@ -541,8 +542,7 @@ int ipoib_ib_dev_stop(struct net_device *dev)

timeout:
	qp_attr.qp_state = IB_QPS_RESET;
	attr_mask        = IB_QP_STATE;
	if (ib_modify_qp(priv->qp, &qp_attr, attr_mask))
	if (ib_modify_qp(priv->qp, &qp_attr, IB_QP_STATE))
		ipoib_warn(priv, "Failed to modify QP to RESET state\n");

	/* Wait for all AHs to be reaped */
+1 −3
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ int ipoib_mcast_attach(struct net_device *dev, u16 mlid, union ib_gid *mgid)
{
	struct ipoib_dev_priv *priv = netdev_priv(dev);
	struct ib_qp_attr *qp_attr;
	int attr_mask;
	int ret;
	u16 pkey_index;

@@ -59,8 +58,7 @@ int ipoib_mcast_attach(struct net_device *dev, u16 mlid, union ib_gid *mgid)

	/* set correct QKey for QP */
	qp_attr->qkey = priv->qkey;
	attr_mask = IB_QP_QKEY;
	ret = ib_modify_qp(priv->qp, qp_attr, attr_mask);
	ret = ib_modify_qp(priv->qp, qp_attr, IB_QP_QKEY);
	if (ret) {
		ipoib_warn(priv, "failed to modify QP, ret = %d\n", ret);
		goto out;