kernel: sem: Remove constant expression

limit is unsigned int and K_SEM_MAX_LIMIT is defined as UINT_MAX this
means that limit will never be greater K_SEM_MAX_LIMIT.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2024-04-27 21:56:17 -07:00 committed by Anas Nashif
commit 68ea73aca2

View file

@ -48,7 +48,7 @@ int z_impl_k_sem_init(struct k_sem *sem, unsigned int initial_count,
/*
* Limit cannot be zero and count cannot be greater than limit
*/
CHECKIF(limit == 0U || limit > K_SEM_MAX_LIMIT || initial_count > limit) {
CHECKIF(limit == 0U || initial_count > limit) {
SYS_PORT_TRACING_OBJ_FUNC(k_sem, init, sem, -EINVAL);
return -EINVAL;