Skip to content

remove check around pthread_mutex_init()

Ariel Otilibili dpdk-dev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest6 patches 2 repliesIn review
  2. v36 patches 4 repliesSuperseded
  3. v26 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v16 patches0 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6raw/ifpga: remove check around pthread_mutex_init()drivers/raw/ifpga/base/opae_intel_max10.c drivers/raw/ifpga/base/opae_spi_transaction.c+2 -100 replies
2/6net/bnxt: remove check around pthread_mutex_init()drivers/net/bnxt/bnxt_ethdev.c drivers/net/bnxt/bnxt_txq.c drivers/net/bnxt/tf_ulp/bnxt_ulp.c +4 more+13 -660 replies
3/6common/cnxk: remove check around pthread_mutex_init()drivers/common/cnxk/roc_bphy_cgx.c+1 -40 replies
4/6net/failsafe: remove check around pthread_mutex_init()drivers/net/failsafe/failsafe.c+2 -60 replies
5/6net/hinic: remove check around pthread_mutex_init()drivers/net/hinic/base/hinic_compat.h+1 -70 replies
6/6lib/vhost: remove check around pthread_mutex_init()lib/vhost/socket.c+2 -122 replies

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchStephen HemmingerMaxime Coquelin
SeriesSeries-Acked-by
1/6A-b
2/6A-b
3/6A-b
4/6A-b
5/6A-b
6/6A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/6] remove check around pthread_mutex_init()

Hello,

This series addresses Bugzilla ID 1586; the man says

Quoted 2 lines

pthread_mutex_init always returns 0. The other mutex functions return 0 on success and a non-zero error code on error.

Meaning, the check around around pthread_mutex_init() is needless.

```
$ git grep -Pn '=\s?pthread_mutex_init\('
drivers/common/cnxk/roc_bphy_cgx.c:197: ret = pthread_mutex_init(&roc_cgx->lock, NULL);
drivers/net/bnxt/bnxt_ethdev.c:5826:    err = pthread_mutex_init(&bp->flow_lock, NULL);
drivers/net/bnxt/bnxt_ethdev.c:5832:    err = pthread_mutex_init(&bp->def_cp_lock, NULL);
drivers/net/bnxt/bnxt_ethdev.c:5838:    err = pthread_mutex_init(&bp->health_check_lock, NULL);
drivers/net/bnxt/bnxt_ethdev.c:5844:    err = pthread_mutex_init(&bp->err_recovery_lock, NULL);
drivers/net/bnxt/bnxt_ethdev.c:6773:    rc = pthread_mutex_init(&bp->rep_info->vfr_start_lock, NULL);
drivers/net/bnxt/bnxt_txq.c:201:        rc = pthread_mutex_init(&txq->txq_lock, NULL);
drivers/net/bnxt/tf_ulp/bnxt_ulp.c:218:                 rc = pthread_mutex_init(&session->bnxt_ulp_mutex, NULL);
drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c:1475:     rc = pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL);
drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c:996:     rc = pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL);
drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c:132:       rc = pthread_mutex_init(&ulp_fc_info->fc_lock, NULL);
drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c:415:       rc = pthread_mutex_init(&ha_info->ha_lock, NULL);
drivers/net/failsafe/failsafe.c:150:    ret = pthread_mutex_init(&priv->hotplug_mutex, &attr);
drivers/net/hinic/base/hinic_compat.h:205:      err = pthread_mutex_init(pthreadmutex, mattr);
drivers/raw/ifpga/base/opae_intel_max10.c:1489:         ret = pthread_mutex_init(&dev->bmc_ops.lock, NULL);
drivers/raw/ifpga/base/opae_spi_transaction.c:510:      ret = pthread_mutex_init(&spi_tran_dev->lock, NULL);
lib/vhost/socket.c:501: ret = pthread_mutex_init(&reconn_list.mutex, NULL);
lib/vhost/socket.c:924: ret = pthread_mutex_init(&vsocket->conn_mutex, NULL);
```

Thank you,

Bugzilla ID: 1586

---
v4
* addressed feedback, turned returns into tail calls
* reworded the cover letter
v3 (https://inbox.dpdk.org/dev/[email protected]/)
* fix style issues
v2 (https://inbox.dpdk.org/dev/[email protected]/)
* fix build issues
v1 (https://inbox.dpdk.org/dev/[email protected]/#t)

Ariel Otilibili (6):
raw/ifpga: remove check around pthread_mutex_init() net/bnxt: remove check around pthread_mutex_init() common/cnxk: remove check around pthread_mutex_init() net/failsafe: remove check around pthread_mutex_init() net/hinic: remove check around pthread_mutex_init() lib/vhost: remove check around pthread_mutex_init()

 drivers/common/cnxk/roc_bphy_cgx.c            |  5 +--
 drivers/net/bnxt/bnxt_ethdev.c                | 40 ++++---------------
 drivers/net/bnxt/bnxt_txq.c                   |  7 +---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |  8 +---
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c         |  6 +--
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c        |  6 +--
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c          |  6 +--
 drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c          |  6 +--
 drivers/net/failsafe/failsafe.c               |  8 +---
 drivers/net/hinic/base/hinic_compat.h         |  8 +---
 drivers/raw/ifpga/base/opae_intel_max10.c     |  5 +--
 drivers/raw/ifpga/base/opae_spi_transaction.c |  7 +---
 lib/vhost/socket.c                            | 14 +------
 13 files changed, 21 insertions(+), 105 deletions(-)
Signature · 1 line
2.30.2