@@ -5821,31 +5821,12 @@ static int bnxt_get_config(struct bnxt *bp)
static int
bnxt_init_locks(struct bnxt *bp)
{
- int err;
+ pthread_mutex_init(&bp->flow_lock, NULL);
+ pthread_mutex_init(&bp->def_cp_lock, NULL);
+ pthread_mutex_init(&bp->health_check_lock, NULL);
+ pthread_mutex_init(&bp->err_recovery_lock, NULL);
- err = pthread_mutex_init(&bp->flow_lock, NULL);
- if (err) {
- PMD_DRV_LOG_LINE(ERR, "Unable to initialize flow_lock");
- return err;
- }
-
- err = pthread_mutex_init(&bp->def_cp_lock, NULL);
- if (err) {
- PMD_DRV_LOG_LINE(ERR, "Unable to initialize def_cp_lock");
- return err;
- }
-
- err = pthread_mutex_init(&bp->health_check_lock, NULL);
- if (err) {
- PMD_DRV_LOG_LINE(ERR, "Unable to initialize health_check_lock");
- return err;
- }
-
- err = pthread_mutex_init(&bp->err_recovery_lock, NULL);
- if (err)
- PMD_DRV_LOG_LINE(ERR, "Unable to initialize err_recovery_lock");
-
- return err;
+ return 0;
}
/* This should be called after we have queried trusted VF cap */
@@ -6746,7 +6727,7 @@ static void bnxt_free_rep_info(struct bnxt *bp)
static int bnxt_init_rep_info(struct bnxt *bp)
{
- int i = 0, rc;
+ int i = 0;
if (bp->rep_info)
return 0;
@@ -6770,14 +6751,7 @@ static int bnxt_init_rep_info(struct bnxt *bp)
for (i = 0; i < BNXT_MAX_CFA_CODE; i++)
bp->cfa_code_map[i] = BNXT_VF_IDX_INVALID;
- rc = pthread_mutex_init(&bp->rep_info->vfr_start_lock, NULL);
- if (rc) {
- PMD_DRV_LOG_LINE(ERR, "Unable to initialize vfr_start_lock");
- bnxt_free_rep_info(bp);
- return rc;
- }
-
- return rc;
+ return pthread_mutex_init(&bp->rep_info->vfr_start_lock, NULL);
}
static int bnxt_rep_port_probe(struct rte_pci_device *pci_dev,
@@ -198,12 +198,7 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
goto err;
}
- rc = pthread_mutex_init(&txq->txq_lock, NULL);
- if (rc != 0) {
- PMD_DRV_LOG_LINE(ERR, "TxQ mutex init failed!");
- goto err;
- }
- return 0;
+ return pthread_mutex_init(&txq->txq_lock, NULL);
err:
bnxt_tx_queue_release_op(eth_dev, queue_idx);
return rc;
@@ -188,7 +188,6 @@ ulp_session_init(struct bnxt *bp,
struct rte_pci_device *pci_dev;
struct rte_pci_addr *pci_addr;
struct bnxt_ulp_session_state *session;
- int rc = 0;
if (!bp)
return NULL;
@@ -215,12 +214,7 @@ ulp_session_init(struct bnxt *bp,
session->pci_info.domain = pci_addr->domain;
session->pci_info.bus = pci_addr->bus;
memcpy(session->dsn, bp->dsn, sizeof(session->dsn));
- rc = pthread_mutex_init(&session->bnxt_ulp_mutex, NULL);
- if (rc) {
- BNXT_DRV_DBG(ERR, "mutex create failed\n");
- pthread_mutex_unlock(&bnxt_ulp_global_mutex);
- return NULL;
- }
+ pthread_mutex_init(&session->bnxt_ulp_mutex, NULL);
STAILQ_INSERT_TAIL(&bnxt_ulp_session_list,
session, next);
}
@@ -1472,11 +1472,7 @@ ulp_tf_init(struct bnxt *bp,
goto jump_to_error;
}
- rc = pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL);
- if (rc) {
- BNXT_DRV_DBG(ERR, "Unable to initialize flow db lock\n");
- goto jump_to_error;
- }
+ pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL);
/* Initialize ulp dparms with values devargs passed */
rc = ulp_tf_dparms_init(bp, bp->ulp_ctx);
@@ -993,11 +993,7 @@ ulp_tfc_init(struct bnxt *bp,
goto jump_to_error;
}
- rc = pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL);
- if (rc) {
- BNXT_DRV_DBG(ERR, "Unable to initialize flow db lock\n");
- goto jump_to_error;
- }
+ pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL);
rc = ulp_tfc_dparms_init(bp, bp->ulp_ctx, ulp_dev_id);
if (rc) {
@@ -129,11 +129,7 @@ ulp_fc_mgr_init(struct bnxt_ulp_context *ctxt)
ulp_fc_info->fc_ops = fc_ops;
ulp_fc_info->flags = flags;
- rc = pthread_mutex_init(&ulp_fc_info->fc_lock, NULL);
- if (rc) {
- BNXT_DRV_DBG(ERR, "Failed to initialize fc mutex\n");
- goto error;
- }
+ pthread_mutex_init(&ulp_fc_info->fc_lock, NULL);
/* Add the FC info tbl to the ulp context. */
bnxt_ulp_cntxt_ptr2_fc_info_set(ctxt, ulp_fc_info);
@@ -412,11 +412,7 @@ ulp_ha_mgr_init(struct bnxt_ulp_context *ulp_ctx)
/* Add the HA info tbl to the ulp context. */
bnxt_ulp_cntxt_ptr2_ha_info_set(ulp_ctx, ha_info);
- rc = pthread_mutex_init(&ha_info->ha_lock, NULL);
- if (rc) {
- PMD_DRV_LOG_LINE(ERR, "Failed to initialize ha mutex");
- goto cleanup;
- }
+ pthread_mutex_init(&ha_info->ha_lock, NULL);
rc = ulp_ha_mgr_timer_start(ulp_ctx->cfg_data);
if (rc) {
PMD_DRV_LOG_LINE(ERR, "Unable to start timer CB");