soc: arm: Make statements evaluate boolean expressions
MISRA-C requires that the if statement has essentially Boolean type. MISRA-C rule 14.4 Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
353933125f
commit
359adfc959
9 changed files with 20 additions and 20 deletions
|
@ -28,7 +28,7 @@ int stm32_gpio_flags_to_conf(int flags, int *pincfg)
|
|||
int direction = flags & GPIO_DIR_MASK;
|
||||
int pud = flags & GPIO_PUD_MASK;
|
||||
|
||||
if (!pincfg) {
|
||||
if (pincfg == NULL) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ int stm32_gpio_set(u32_t *base, int pin, int value)
|
|||
|
||||
int pval = 1 << (pin & 0xf);
|
||||
|
||||
if (value) {
|
||||
if (value != 0) {
|
||||
gpio->odr |= pval;
|
||||
} else {
|
||||
gpio->odr &= ~pval;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue