Commit 2727c888 authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

bnxt_en: Simplify ring alloc/free error messages.

Replace switch statements printing different messages for every ring type
with a common message.
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ca2c39e2
...@@ -4336,26 +4336,9 @@ static int hwrm_ring_alloc_send_msg(struct bnxt *bp, ...@@ -4336,26 +4336,9 @@ static int hwrm_ring_alloc_send_msg(struct bnxt *bp,
mutex_unlock(&bp->hwrm_cmd_lock); mutex_unlock(&bp->hwrm_cmd_lock);
if (rc || err) { if (rc || err) {
switch (ring_type) { netdev_err(bp->dev, "hwrm_ring_alloc type %d failed. rc:%x err:%x\n",
case RING_FREE_REQ_RING_TYPE_L2_CMPL: ring_type, rc, err);
netdev_err(bp->dev, "hwrm_ring_alloc cp failed. rc:%x err:%x\n", return -EIO;
rc, err);
return -1;
case RING_FREE_REQ_RING_TYPE_RX:
netdev_err(bp->dev, "hwrm_ring_alloc rx failed. rc:%x err:%x\n",
rc, err);
return -1;
case RING_FREE_REQ_RING_TYPE_TX:
netdev_err(bp->dev, "hwrm_ring_alloc tx failed. rc:%x err:%x\n",
rc, err);
return -1;
default:
netdev_err(bp->dev, "Invalid ring\n");
return -1;
}
} }
ring->fw_ring_id = ring_id; ring->fw_ring_id = ring_id;
return rc; return rc;
...@@ -4479,23 +4462,9 @@ static int hwrm_ring_free_send_msg(struct bnxt *bp, ...@@ -4479,23 +4462,9 @@ static int hwrm_ring_free_send_msg(struct bnxt *bp,
mutex_unlock(&bp->hwrm_cmd_lock); mutex_unlock(&bp->hwrm_cmd_lock);
if (rc || error_code) { if (rc || error_code) {
switch (ring_type) { netdev_err(bp->dev, "hwrm_ring_free type %d failed. rc:%x err:%x\n",
case RING_FREE_REQ_RING_TYPE_L2_CMPL: ring_type, rc, error_code);
netdev_err(bp->dev, "hwrm_ring_free cp failed. rc:%d\n", return -EIO;
rc);
return rc;
case RING_FREE_REQ_RING_TYPE_RX:
netdev_err(bp->dev, "hwrm_ring_free rx failed. rc:%d\n",
rc);
return rc;
case RING_FREE_REQ_RING_TYPE_TX:
netdev_err(bp->dev, "hwrm_ring_free tx failed. rc:%d\n",
rc);
return rc;
default:
netdev_err(bp->dev, "Invalid ring\n");
return -1;
}
} }
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment