On Mon, 10 Feb 2025 09:47:02 +0800
Bingbin Chen <chen.bing...@zte.com.cn> wrote:

> +static uint32_t
> +zxdh_np_comm_mutex_create(ZXDH_MUTEX_T *p_mutex)
> +{
> +     int32_t rc = 0;
> +
> +     rc = pthread_mutex_init(&p_mutex->mutex, NULL);
> +     if (rc != 0) {
> +             PMD_DRV_LOG(ERR, "ErrCode[ 0x%x ]: Create mutex failed",
> +                     ZXDH_MUTEX_LOCK_INIT_FAIL);
> +             return ZXDH_MUTEX_LOCK_INIT_FAIL;
> +     }


We went through this recently with other drivers on the mailing list.
You are adding dead code.

On pthread man page:


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

Reply via email to