From c11516ae9053515fe8ba0349fbdcc0cc78bfda84 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Mon, 4 Apr 2022 16:53:50 +0200 Subject: [PATCH] drivers: pwm: ite_it8xxx2: add missing braces Multiple if/else blocks had missing braces, add them as this violates Zephyr coding guidelines. Signed-off-by: Gerard Marull-Paretas --- drivers/pwm/pwm_ite_it8xxx2.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/pwm/pwm_ite_it8xxx2.c b/drivers/pwm/pwm_ite_it8xxx2.c index aeee35910a9..ee166bfe729 100644 --- a/drivers/pwm/pwm_ite_it8xxx2.c +++ b/drivers/pwm/pwm_ite_it8xxx2.c @@ -58,12 +58,13 @@ static void pwm_enable(const struct device *dev, int enabled) volatile uint8_t *reg_pcsgr = (uint8_t *)config->reg_pcsgr; int ch = config->channel; - if (enabled) + if (enabled) { /* PWM channel clock source not gating */ *reg_pcsgr &= ~BIT(ch); - else + } else { /* PWM channel clock source gating */ *reg_pcsgr |= BIT(ch); + } } static int pwm_it8xxx2_get_cycles_per_sec(const struct device *dev, @@ -113,10 +114,11 @@ static int pwm_it8xxx2_pin_set(const struct device *dev, pwm_enable(dev, 0); /* Select PWM inverted polarity (ex. active-low pulse) */ - if (flags & PWM_POLARITY_INVERTED) + if (flags & PWM_POLARITY_INVERTED) { *reg_pwmpol |= BIT(ch); - else + } else { *reg_pwmpol &= ~BIT(ch); + } /* If pulse cycles is 0, set duty cycle 0 and enable pwm channel */ if (pulse_cycles == 0) {