<html>
    <head>
      <base href="https://bugs.dpdk.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8" class="bz_new_table">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Drivers are doing useless check for pthread_mutex_init return value"
   href="https://bugs.dpdk.org/show_bug.cgi?id=1586">1586</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Drivers are doing useless check for pthread_mutex_init return value
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>DPDK
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>24.11
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>minor
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>ethdev
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dev@dpdk.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>stephen@networkplumber.org
          </td>
        </tr>

        <tr>
          <th>Target Milestone</th>
          <td>---
          </td>
        </tr></table>
      <p>
        <div class="bz_comment_block">
          <pre class="bz_comment_text">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);
          </pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
      <div itemscope itemtype="http://schema.org/EmailMessage">
        <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
          
          <link itemprop="url" href="https://bugs.dpdk.org/show_bug.cgi?id=1586">
          <meta itemprop="name" content="View bug">
        </div>
        <meta itemprop="description" content="Bugzilla bug update notification">
      </div>
    </body>
</html>