tests: drivers: gpio_basic_api: silence coverity warning

In most cases gpio_pin_configure()'s return value is checked in this
application; Coverity noted a case where it is not checked.  Add a
check to make it happy.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2020-03-11 05:53:35 -05:00 committed by Anas Nashif
commit 6ec675ca2f

View file

@ -21,6 +21,7 @@ static int cb_cnt;
static void callback(struct device *dev, static void callback(struct device *dev,
struct gpio_callback *gpio_cb, u32_t pins) struct gpio_callback *gpio_cb, u32_t pins)
{ {
int rc;
const struct drv_data *dd = CONTAINER_OF(gpio_cb, const struct drv_data *dd = CONTAINER_OF(gpio_cb,
struct drv_data, gpio_cb); struct drv_data, gpio_cb);
@ -43,8 +44,10 @@ static void callback(struct device *dev,
* level interrupts to repeat forever. To prevent hangs * level interrupts to repeat forever. To prevent hangs
* it's necessary to explicitly disable the interrupt. * it's necessary to explicitly disable the interrupt.
*/ */
gpio_pin_configure(dev, PIN_IN, GPIO_DIR_IN rc = gpio_pin_configure(dev, PIN_IN, GPIO_DIR_IN
| GPIO_INT_DISABLE); | GPIO_INT_DISABLE);
zassert_equal(rc, 0,
"disable interrupts failed: %d", rc);
} }
} }