arch: kernel_arch_func.h: Fix MISRA violation

Always compare unsigned interger type with another unsigned
integer type. Currently in nios2, posix, riscv32, x86 and xtensa
we were comparing the _kernel.nested variable with a signed
interger type. Fixed this violation.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
This commit is contained in:
Adithya Baglody 2018-10-16 11:45:23 +05:30 committed by Anas Nashif
commit e9cb0ae72a
5 changed files with 5 additions and 5 deletions

View file

@ -46,7 +46,7 @@ static inline void _IntLibInit(void)
/* No special initialization of the interrupt subsystem required */
}
#define _is_in_isr() (_kernel.nested != 0)
#define _is_in_isr() (_kernel.nested != 0U)
#ifdef CONFIG_IRQ_OFFLOAD
void _irq_do_offload(void);

View file

@ -63,7 +63,7 @@ static inline void _IntLibInit(void)
}
#endif
#define _is_in_isr() (_kernel.nested != 0)
#define _is_in_isr() (_kernel.nested != 0U)
#endif /* _ASMLANGUAGE */

View file

@ -48,7 +48,7 @@ FUNC_NORETURN void _NanoFatalErrorHandler(unsigned int reason,
const NANO_ESF *esf);
#define _is_in_isr() (_kernel.nested != 0)
#define _is_in_isr() (_kernel.nested != 0U)
#ifdef CONFIG_IRQ_OFFLOAD
int _irq_do_offload(void);

View file

@ -142,7 +142,7 @@ extern FUNC_NORETURN void _x86_userspace_enter(k_thread_entry_t user_entry,
}
#endif
#define _is_in_isr() (_kernel.nested != 0)
#define _is_in_isr() (_kernel.nested != 0U)
#endif /* _ASMLANGUAGE */

View file

@ -122,7 +122,7 @@ static inline void _IntLibInit(void)
}
#endif
#define _is_in_isr() (_arch_curr_cpu()->nested != 0)
#define _is_in_isr() (_arch_curr_cpu()->nested != 0U)
#endif /* _ASMLANGUAGE */