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:
parent
930c904c67
commit
6ec675ca2f
1 changed files with 5 additions and 2 deletions
|
@ -21,6 +21,7 @@ static int cb_cnt;
|
|||
static void callback(struct device *dev,
|
||||
struct gpio_callback *gpio_cb, u32_t pins)
|
||||
{
|
||||
int rc;
|
||||
const struct drv_data *dd = CONTAINER_OF(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
|
||||
* it's necessary to explicitly disable the interrupt.
|
||||
*/
|
||||
gpio_pin_configure(dev, PIN_IN, GPIO_DIR_IN
|
||||
| GPIO_INT_DISABLE);
|
||||
rc = gpio_pin_configure(dev, PIN_IN, GPIO_DIR_IN
|
||||
| GPIO_INT_DISABLE);
|
||||
zassert_equal(rc, 0,
|
||||
"disable interrupts failed: %d", rc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue