Skip to content

Commit

Permalink
net/hinic: remove check around pthread_mutex_init
Browse files Browse the repository at this point in the history
> 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 <xuanziyang2@huawei.com>
Cc: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
  • Loading branch information
ariel-anieli authored and shemminger committed Jan 17, 2025
1 parent e490dc5 commit 6876703
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/net/hinic/base/hinic_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6876703

Please sign in to comment.