DPDK patches and discussions
 help / color / mirror / Atom feed
* [DPDK/ethdev Bug 1586] Drivers are doing useless check for pthread_mutex_init return value
@ 2024-11-20 22:54 bugzilla
  0 siblings, 0 replies; only message in thread
From: bugzilla @ 2024-11-20 22:54 UTC (permalink / raw)
  To: dev

[-- Attachment #1: Type: text/plain, Size: 2685 bytes --]

https://bugs.dpdk.org/show_bug.cgi?id=1586

            Bug ID: 1586
           Summary: Drivers are doing useless check for pthread_mutex_init
                    return value
           Product: DPDK
           Version: 24.11
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: minor
          Priority: Normal
         Component: ethdev
          Assignee: dev@dpdk.org
          Reporter: stephen@networkplumber.org
  Target Milestone: ---

Various checkers will warn that checking the return value of
pthread_mutex_init() will always be zero.

The documentation states:

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

Very minor issue, since it only results in bogus warnings and few instructions
of extra code in the startup path.

drivers/common/cnxk/roc_bphy_cgx.c:     ret =
pthread_mutex_init(&roc_cgx->lock, NULL);
drivers/net/bnxt/bnxt_ethdev.c: err = pthread_mutex_init(&bp->flow_lock, NULL);
drivers/net/bnxt/bnxt_ethdev.c: err = pthread_mutex_init(&bp->def_cp_lock,
NULL);
drivers/net/bnxt/bnxt_ethdev.c: err =
pthread_mutex_init(&bp->health_check_lock, NULL);
drivers/net/bnxt/bnxt_ethdev.c: err =
pthread_mutex_init(&bp->err_recovery_lock, NULL);
drivers/net/bnxt/bnxt_ethdev.c: rc =
pthread_mutex_init(&bp->rep_info->vfr_start_lock, NULL);
drivers/net/bnxt/bnxt_txq.c:    rc = pthread_mutex_init(&txq->txq_lock, NULL);
drivers/net/bnxt/tf_ulp/bnxt_ulp.c:                     rc =
pthread_mutex_init(&session->bnxt_ulp_mutex, NULL);
drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c:  rc =
pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL);
drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c: rc =
pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL);
drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c:   rc =
pthread_mutex_init(&ulp_fc_info->fc_lock, NULL);
drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c:   rc =
pthread_mutex_init(&ha_info->ha_lock, NULL);
drivers/net/failsafe/failsafe.c:        ret =
pthread_mutex_init(&priv->hotplug_mutex, &attr);
drivers/net/hinic/base/hinic_compat.h:  err = pthread_mutex_init(pthreadmutex,
mattr);
drivers/raw/ifpga/base/opae_intel_max10.c:              ret =
pthread_mutex_init(&dev->bmc_ops.lock, NULL);
drivers/raw/ifpga/base/opae_spi_transaction.c:  ret =
pthread_mutex_init(&spi_tran_dev->lock, NULL);
lib/vhost/socket.c:     ret = pthread_mutex_init(&reconn_list.mutex, NULL);
lib/vhost/socket.c:     ret = pthread_mutex_init(&vsocket->conn_mutex, NULL);

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #2: Type: text/html, Size: 4694 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-11-20 22:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-20 22:54 [DPDK/ethdev Bug 1586] Drivers are doing useless check for pthread_mutex_init return value bugzilla

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).