Opened on 01/19/17 at 21:03:33
Last modified on 05/22/17 at 21:37:38
#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: | ||
Blocking: |
Description
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 ) {
but
static int debounce_switch(gpio_pin_interrupt_state *interrupt_state)
and
uint8_t rv;
Attachments (1)
Change History (3)
comment:1 Changed on 02/15/17 at 14:20:42 by Sebastian Huber
Milestone: | 4.12 → Indefinite |
---|---|
Owner: | set to Needs Funding |
Status: | new → assigned |
comment:2 Changed on 05/22/17 at 21:37:38 by Stavros Passas
Changed on 05/22/17 at 21:38:08 by Stavros Passas
Attachment: | 2876-Fix-gpio-warning-error-checking.patch added |
---|
suggested fix
Note: See
TracTickets for help on using
tickets.
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.