> pthread_mutex_init always returns 0. The other mutex functions > return 0 on success and a non-zero error code on error.
Link: https://man7.org/linux/man-pages/man3/pthread_mutex_lock.3.html Bugzilla ID: 1586 Cc: Ziyang Xuan <xuanziya...@huawei.com> Cc: Xiaoyun Wang <cloud.wangxiao...@huawei.com> Signed-off-by: Ariel Otilibili <otili...@eurecom.fr> Acked-by: Stephen Hemminger <step...@networkplumber.org> --- drivers/net/hinic/base/hinic_compat.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/net/hinic/base/hinic_compat.h b/drivers/net/hinic/base/hinic_compat.h index ab9d1b9a0214..d3994c50e939 100644 --- a/drivers/net/hinic/base/hinic_compat.h +++ b/drivers/net/hinic/base/hinic_compat.h @@ -200,13 +200,7 @@ static inline u16 ilog2(u32 n) static inline int hinic_mutex_init(pthread_mutex_t *pthreadmutex, const pthread_mutexattr_t *mattr) { - int err; - - err = pthread_mutex_init(pthreadmutex, mattr); - if (unlikely(err)) - PMD_DRV_LOG(ERR, "Fail to initialize mutex, error: %d", err); - - return err; + return pthread_mutex_init(pthreadmutex, mattr); } static inline int hinic_mutex_destroy(pthread_mutex_t *pthreadmutex) -- 2.30.2