#2876 assigned defect

src/c/src/lib/libbsp/shared/gpio.c:251: broken error checking ?

Reported by: David Binderman Owned by: Needs Funding
Priority: normal Milestone: Indefinite
Component: unspecified Version: 4.11
Severity: normal Keywords:
Cc: Blocked By:


src/c/src/lib/libbsp/shared/gpio.c:251]: (style) Checking if unsigned variable 'rv' is less than zero.

Source code is

rv = debounce_switch(interrupt_state);

/* If the handler call was caused by a switch bounce,

  • ignores and move on. */

if ( rv < 0 ) {


static int debounce_switch(gpio_pin_interrupt_state *interrupt_state)


uint8_t rv;

Attachments (1)

2876-Fix-gpio-warning-error-checking.patch (1.1 KB) - added by Stavros Passas on 05/22/17 at 21:38:08.
suggested fix

Download all attachments as: .zip

Change History (3)

comment:1 Changed on 02/15/17 at 14:20:42 by Sebastian Huber

Milestone: 4.12Indefinite
Owner: set to Needs Funding
Status: newassigned

comment:2 Changed on 05/22/17 at 21:37:38 by Stavros Passas

Mainly debounce_switch returns an integer and -1 if an error occurs. Thus by changing rv to int this error checking is fixed. I think we should change both of them to int32_t for consistency with the rest RTEMS.

Changed on 05/22/17 at 21:38:08 by Stavros Passas

suggested fix

Note: See TracTickets for help on using tickets.