From: Ariel Otilibili <otilibil@eurecom.fr>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Thomas Monjalon <thomas@monjalon.net>,
David Marchand <david.marchand@redhat.com>,
Ariel Otilibili <otilibil@eurecom.fr>,
Maxime Coquelin <maxime.coquelin@redhat.com>,
Chenbo Xia <chenbox@nvidia.com>,
Ziyang Xuan <xuanziyang2@huawei.com>,
Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>,
Gaetan Rivet <grive@u256.net>,
Nithin Dabilpuram <ndabilpuram@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Sunil Kumar Kori <skori@marvell.com>,
Satha Rao <skoteshwar@marvell.com>,
Harman Kalra <hkalra@marvell.com>,
Ajit Khaparde <ajit.khaparde@broadcom.com>,
Somnath Kotur <somnath.kotur@broadcom.com>,
Rosen Xu <rosen.xu@intel.com>
Subject: [PATCH v4 0/6] remove check around pthread_mutex_init()
Date: Tue, 14 Jan 2025 08:50:27 +0100 [thread overview]
Message-ID: <20250114075033.2027286-1-otilibil@eurecom.fr> (raw)
In-Reply-To: <20250112185842.9752-1-otilibil@eurecom.fr>
Hello,
This series addresses Bugzilla ID 1586; the man says
> 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,
Link: https://man7.org/linux/man-pages/man3/pthread_mutex_lock.3.html
Bugzilla ID: 1586
Series-Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
v4
* addressed feedback, turned returns into tail calls
* reworded the cover letter
v3 (https://inbox.dpdk.org/dev/20250112202021.179634-1-otilibil@eurecom.fr/)
* fix style issues
v2 (https://inbox.dpdk.org/dev/20250112193043.67372-1-otilibil@eurecom.fr/)
* fix build issues
v1 (https://inbox.dpdk.org/dev/20250112185842.9752-1-otilibil@eurecom.fr/#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(-)
--
2.30.2
next prev parent reply other threads:[~2025-01-14 7:50 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-12 18:58 [PATCH " Ariel Otilibili
2025-01-12 18:58 ` [PATCH 1/6] raw/ifpga: " Ariel Otilibili
2025-01-12 18:58 ` [PATCH 2/6] net/bnxt: " Ariel Otilibili
2025-01-12 18:58 ` [PATCH 3/6] common/cnxk: " Ariel Otilibili
2025-01-12 18:58 ` [PATCH 4/6] net/failsafe: " Ariel Otilibili
2025-01-12 18:58 ` [PATCH 5/6] net/hinic: " Ariel Otilibili
2025-01-12 18:58 ` [PATCH 6/6] lib/vhost: " Ariel Otilibili
2025-01-12 19:30 ` [PATCH v2 0/6] " Ariel Otilibili
2025-01-12 19:30 ` [PATCH v2 1/6] raw/ifpga: " Ariel Otilibili
2025-01-12 19:30 ` [PATCH v2 2/6] net/bnxt: " Ariel Otilibili
2025-01-12 19:30 ` [PATCH v2 3/6] common/cnxk: " Ariel Otilibili
2025-01-12 19:30 ` [PATCH v2 4/6] net/failsafe: " Ariel Otilibili
2025-01-12 19:30 ` [PATCH v2 5/6] net/hinic: " Ariel Otilibili
2025-01-12 19:30 ` [PATCH v2 6/6] lib/vhost: " Ariel Otilibili
2025-01-12 20:20 ` [PATCH v3 0/6] " Ariel Otilibili
2025-01-12 20:20 ` [PATCH v3 1/6] raw/ifpga: " Ariel Otilibili
2025-01-12 20:20 ` [PATCH v3 2/6] net/bnxt: " Ariel Otilibili
2025-01-12 20:20 ` [PATCH v3 3/6] common/cnxk: " Ariel Otilibili
2025-01-12 20:20 ` [PATCH v3 4/6] net/failsafe: " Ariel Otilibili
2025-01-13 19:10 ` Stephen Hemminger
2025-01-12 20:20 ` [PATCH v3 5/6] net/hinic: " Ariel Otilibili
2025-01-13 19:09 ` Stephen Hemminger
2025-01-12 20:20 ` [PATCH v3 6/6] lib/vhost: " Ariel Otilibili
2025-01-13 19:11 ` [PATCH v3 0/6] " Stephen Hemminger
2025-01-14 8:22 ` Ariel Otilibili-Anieli
2025-01-13 17:19 ` [PATCH 0/1] eal/linux: Remove unused values Ariel Otilibili
2025-01-13 17:19 ` [PATCH 1/1] " Ariel Otilibili
2025-01-14 7:50 ` Ariel Otilibili [this message]
2025-01-14 7:50 ` [PATCH v4 1/6] raw/ifpga: remove check around pthread_mutex_init() Ariel Otilibili
2025-01-14 7:50 ` [PATCH v4 2/6] net/bnxt: " Ariel Otilibili
2025-01-14 7:50 ` [PATCH v4 3/6] common/cnxk: " Ariel Otilibili
2025-01-14 7:50 ` [PATCH v4 4/6] net/failsafe: " Ariel Otilibili
2025-01-14 7:50 ` [PATCH v4 5/6] net/hinic: " Ariel Otilibili
2025-01-14 7:50 ` [PATCH v4 6/6] lib/vhost: " Ariel Otilibili
2025-01-14 8:48 ` Maxime Coquelin
2025-01-14 11:03 ` Ariel Otilibili-Anieli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250114075033.2027286-1-otilibil@eurecom.fr \
--to=otilibil@eurecom.fr \
--cc=ajit.khaparde@broadcom.com \
--cc=chenbox@nvidia.com \
--cc=cloud.wangxiaoyun@huawei.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=grive@u256.net \
--cc=hkalra@marvell.com \
--cc=kirankumark@marvell.com \
--cc=maxime.coquelin@redhat.com \
--cc=ndabilpuram@marvell.com \
--cc=rosen.xu@intel.com \
--cc=skori@marvell.com \
--cc=skoteshwar@marvell.com \
--cc=somnath.kotur@broadcom.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
--cc=xuanziyang2@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).