All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [DPDK/ethdev Bug 1586] Drivers are doing useless check for pthread_mutex_init return value
Date: Wed, 20 Nov 2024 22:54:10 +0000	[thread overview]
Message-ID: <bug-1586-3@http.bugs.dpdk.org/> (raw)

[-- 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 --]

             reply	other threads:[~2024-11-20 22:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-20 22:54 bugzilla [this message]
2025-03-26 14:08 ` [DPDK/ethdev Bug 1586] Drivers are doing useless check for pthread_mutex_init return value bugzilla

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=bug-1586-3@http.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.org \
    --cc=dev@dpdk.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.