arch: common: Fix 10.4 violations

Both operands of an operator in which the usual arithmetic
conversions are performed shall have the same essential
type category.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2021-04-02 22:55:18 -07:00 committed by Anas Nashif
parent 4f5460ad6a
commit 49f0c74a9e
2 changed files with 5 additions and 5 deletions

View file

@ -54,9 +54,9 @@ unsigned int get_parent_offset(unsigned int parent_irq,
unsigned int length)
{
unsigned int i;
unsigned int offset = 0;
unsigned int offset = 0U;
for (i = 0; i < length; ++i) {
for (i = 0U; i < length; ++i) {
if (list[i].irq == parent_irq) {
offset = list[i].offset;
break;
@ -91,7 +91,7 @@ void z_isr_install(unsigned int irq, void (*routine)(const void *),
level = irq_get_level(irq);
if (level == 2) {
if (level == 2U) {
parent_irq = irq_parent_level_2(irq);
parent_offset = get_parent_offset(parent_irq,
lvl2_irq_list,
@ -99,7 +99,7 @@ void z_isr_install(unsigned int irq, void (*routine)(const void *),
table_idx = parent_offset + irq_from_level_2(irq);
}
#ifdef CONFIG_3RD_LEVEL_INTERRUPTS
else if (level == 3) {
else if (level == 3U) {
parent_irq = irq_parent_level_3(irq);
parent_offset = get_parent_offset(parent_irq,
lvl3_irq_list,

View file

@ -49,5 +49,5 @@ uint64_t arch_timing_cycles_to_ns_avg(uint64_t cycles, uint32_t count)
uint32_t arch_timing_freq_get_mhz(void)
{
return (uint32_t)(arch_timing_freq_get() / 1000000);
return (uint32_t)(arch_timing_freq_get() / 1000000U);
}