From 68767031edf83c32643c77d36eb9427ba1f3afba Mon Sep 17 00:00:00 2001 From: Ariel Otilibili Date: Tue, 14 Jan 2025 08:50:32 +0100 Subject: [PATCH] net/hinic: remove check around pthread_mutex_init > 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 Cc: Xiaoyun Wang Signed-off-by: Ariel Otilibili Acked-by: Stephen Hemminger --- 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 ab9d1b9a021..d3994c50e93 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)