Skip to content

Commit 49f0c74

Browse files
Flavio Ceolinnashif
authored andcommitted
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 <[email protected]>
1 parent 4f5460a commit 49f0c74

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

arch/common/sw_isr_common.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ unsigned int get_parent_offset(unsigned int parent_irq,
5454
unsigned int length)
5555
{
5656
unsigned int i;
57-
unsigned int offset = 0;
57+
unsigned int offset = 0U;
5858

59-
for (i = 0; i < length; ++i) {
59+
for (i = 0U; i < length; ++i) {
6060
if (list[i].irq == parent_irq) {
6161
offset = list[i].offset;
6262
break;
@@ -91,15 +91,15 @@ void z_isr_install(unsigned int irq, void (*routine)(const void *),
9191

9292
level = irq_get_level(irq);
9393

94-
if (level == 2) {
94+
if (level == 2U) {
9595
parent_irq = irq_parent_level_2(irq);
9696
parent_offset = get_parent_offset(parent_irq,
9797
lvl2_irq_list,
9898
CONFIG_NUM_2ND_LEVEL_AGGREGATORS);
9999
table_idx = parent_offset + irq_from_level_2(irq);
100100
}
101101
#ifdef CONFIG_3RD_LEVEL_INTERRUPTS
102-
else if (level == 3) {
102+
else if (level == 3U) {
103103
parent_irq = irq_parent_level_3(irq);
104104
parent_offset = get_parent_offset(parent_irq,
105105
lvl3_irq_list,

arch/common/timing.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ uint64_t arch_timing_cycles_to_ns_avg(uint64_t cycles, uint32_t count)
4949

5050
uint32_t arch_timing_freq_get_mhz(void)
5151
{
52-
return (uint32_t)(arch_timing_freq_get() / 1000000);
52+
return (uint32_t)(arch_timing_freq_get() / 1000000U);
5353
}

0 commit comments

Comments
 (0)