include: 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:
Flavio Ceolin 2019-03-08 14:56:56 -08:00 committed by Anas Nashif
commit 063a9ce8c3
11 changed files with 24 additions and 22 deletions

View file

@ -165,7 +165,7 @@ static inline int z_impl_gpio_enable_callback(struct device *port,
const struct gpio_driver_api *api =
(const struct gpio_driver_api *)port->driver_api;
if (!api->enable_callback) {
if (api->enable_callback == NULL) {
return -ENOTSUP;
}
@ -181,7 +181,7 @@ static inline int z_impl_gpio_disable_callback(struct device *port,
const struct gpio_driver_api *api =
(const struct gpio_driver_api *)port->driver_api;
if (!api->disable_callback) {
if (api->disable_callback == NULL) {
return -ENOTSUP;
}
@ -268,7 +268,7 @@ static inline int gpio_add_callback(struct device *port,
const struct gpio_driver_api *api =
(const struct gpio_driver_api *)port->driver_api;
if (!api->manage_callback) {
if (api->manage_callback == NULL) {
return -ENOTSUP;
}
@ -297,7 +297,7 @@ static inline int gpio_remove_callback(struct device *port,
const struct gpio_driver_api *api =
(const struct gpio_driver_api *)port->driver_api;
if (!api->manage_callback) {
if (api->manage_callback == NULL) {
return -ENOTSUP;
}
@ -428,7 +428,7 @@ static inline int z_impl_gpio_get_pending_int(struct device *dev)
const struct gpio_driver_api *api =
(const struct gpio_driver_api *)dev->driver_api;
if (!api->get_pending_int) {
if (api->get_pending_int == NULL) {
return -ENOTSUP;
}