diff --git a/arch/x86/core/acpi.c b/arch/x86/core/acpi.c index d451b7ee506..240aa472d0e 100644 --- a/arch/x86/core/acpi.c +++ b/arch/x86/core/acpi.c @@ -147,7 +147,7 @@ struct acpi_cpu *z_acpi_get_cpu(int n) if (entry->type == ACPI_MADT_ENTRY_CPU) { struct acpi_cpu *cpu = (struct acpi_cpu *)entry; - if (cpu->flags & ACPI_CPU_FLAGS_ENABLED) { + if ((cpu->flags & ACPI_CPU_FLAGS_ENABLED) != 0) { if (n == 0) { return cpu; } diff --git a/arch/x86/core/early_serial.c b/arch/x86/core/early_serial.c index 58613e25cce..aa3aacc99d6 100644 --- a/arch/x86/core/early_serial.c +++ b/arch/x86/core/early_serial.c @@ -110,7 +110,7 @@ void z_x86_early_serial_init(void) early_serial_init_done = true; - if (suppressed_chars) { + if (suppressed_chars != 0U) { printk("WARNING: %u chars lost before early serial init\n", suppressed_chars); } diff --git a/arch/x86/core/x86_mmu.c b/arch/x86/core/x86_mmu.c index ec2c820fc84..ed598f4763c 100644 --- a/arch/x86/core/x86_mmu.c +++ b/arch/x86/core/x86_mmu.c @@ -518,7 +518,7 @@ static void print_entries(pentry_t entries_array[], uint8_t *base, int level, uintptr_t virt = (uintptr_t)base + (get_entry_scope(level) * i); - if (entry & MMU_P) { + if ((entry & MMU_P) != 0U) { if (is_leaf(level, entry)) { if (phys == virt) { /* Identity mappings */ diff --git a/drivers/counter/counter_cmos.c b/drivers/counter/counter_cmos.c index 0a23fc48822..f2006ff32ca 100644 --- a/drivers/counter/counter_cmos.c +++ b/drivers/counter/counter_cmos.c @@ -154,14 +154,14 @@ int get_value(const struct device *dev, uint32_t *ticks) * the HOUR_PM flag before we adjust for BCD. */ - if (state.status_b & STATUS_B_24HR) { + if ((state.status_b & STATUS_B_24HR) != 0U) { pm = false; } else { pm = ((state.hour & HOUR_PM) == HOUR_PM); state.hour &= ~HOUR_PM; } - if (!(state.status_b & STATUS_B_BIN)) { + if ((state.status_b & STATUS_B_BIN) == 0U) { uint8_t *cp = (uint8_t *) &state; int i; diff --git a/kernel/device.c b/kernel/device.c index 4b6c6d8564b..d8456d9b3ab 100644 --- a/kernel/device.c +++ b/kernel/device.c @@ -112,7 +112,7 @@ const struct device *z_impl_device_get_binding(const char *name) /* A null string identifies no device. So does an empty * string. */ - if ((name == NULL) || (*name == 0U)) { + if ((name == NULL) || (name[0] == '\0')) { return NULL; }