Skip to content

Commit

Permalink
bnxt_en: Modify some bnxt_hwrm_*_free() functions to void.
Browse files Browse the repository at this point in the history
Return code is not needed in some of these functions, as the return
code from firmware message is ignored. Remove the unused rc variable
and also convert functions to void.

Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vasundhara Volam authored and David S. Miller committed Mar 9, 2020
1 parent 9f90445 commit 3d06159
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -5060,21 +5060,18 @@ int bnxt_hwrm_vnic_cfg(struct bnxt *bp, u16 vnic_id)
return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
}

static int bnxt_hwrm_vnic_free_one(struct bnxt *bp, u16 vnic_id)
static void bnxt_hwrm_vnic_free_one(struct bnxt *bp, u16 vnic_id)
{
u32 rc = 0;

if (bp->vnic_info[vnic_id].fw_vnic_id != INVALID_HW_RING_ID) {
struct hwrm_vnic_free_input req = {0};

bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_VNIC_FREE, -1, -1);
req.vnic_id =
cpu_to_le32(bp->vnic_info[vnic_id].fw_vnic_id);

rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
bp->vnic_info[vnic_id].fw_vnic_id = INVALID_HW_RING_ID;
}
return rc;
}

static void bnxt_hwrm_vnic_free(struct bnxt *bp)
Expand Down Expand Up @@ -5191,14 +5188,13 @@ static int bnxt_hwrm_ring_grp_alloc(struct bnxt *bp)
return rc;
}

static int bnxt_hwrm_ring_grp_free(struct bnxt *bp)
static void bnxt_hwrm_ring_grp_free(struct bnxt *bp)
{
u16 i;
u32 rc = 0;
struct hwrm_ring_grp_free_input req = {0};

if (!bp->grp_info || (bp->flags & BNXT_FLAG_CHIP_P5))
return 0;
return;

bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_RING_GRP_FREE, -1, -1);

Expand All @@ -5209,12 +5205,10 @@ static int bnxt_hwrm_ring_grp_free(struct bnxt *bp)
req.ring_group_id =
cpu_to_le32(bp->grp_info[i].fw_grp_id);

rc = _hwrm_send_message(bp, &req, sizeof(req),
HWRM_CMD_TIMEOUT);
_hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
bp->grp_info[i].fw_grp_id = INVALID_HW_RING_ID;
}
mutex_unlock(&bp->hwrm_cmd_lock);
return rc;
}

static int hwrm_ring_alloc_send_msg(struct bnxt *bp,
Expand Down Expand Up @@ -6302,16 +6296,16 @@ int bnxt_hwrm_set_coal(struct bnxt *bp)
return rc;
}

static int bnxt_hwrm_stat_ctx_free(struct bnxt *bp)
static void bnxt_hwrm_stat_ctx_free(struct bnxt *bp)
{
int rc = 0, i;
struct hwrm_stat_ctx_free_input req = {0};
int i;

if (!bp->bnapi)
return 0;
return;

if (BNXT_CHIP_TYPE_NITRO_A0(bp))
return 0;
return;

bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_STAT_CTX_FREE, -1, -1);

Expand All @@ -6323,14 +6317,13 @@ static int bnxt_hwrm_stat_ctx_free(struct bnxt *bp)
if (cpr->hw_stats_ctx_id != INVALID_STATS_CTX_ID) {
req.stat_ctx_id = cpu_to_le32(cpr->hw_stats_ctx_id);

rc = _hwrm_send_message(bp, &req, sizeof(req),
HWRM_CMD_TIMEOUT);
_hwrm_send_message(bp, &req, sizeof(req),
HWRM_CMD_TIMEOUT);

cpr->hw_stats_ctx_id = INVALID_STATS_CTX_ID;
}
}
mutex_unlock(&bp->hwrm_cmd_lock);
return rc;
}

static int bnxt_hwrm_stat_ctx_alloc(struct bnxt *bp)
Expand Down

0 comments on commit 3d06159

Please sign in to comment.