[PATCH v1 03/14] net/zxdh: add agent channel
Stephen Hemminger
stephen at networkplumber.org
Mon Feb 10 18:28:27 CET 2025
On Mon, 10 Feb 2025 09:47:02 +0800
Bingbin Chen <chen.bingbin at 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.
More information about the dev
mailing list