[RTEMS Project] #3301: src/c/src/lib/libbsp/sparc/shared/tmtc/grtc.c:1871]: (style) Suspicious condition

RTEMS trac trac at rtems.org
Wed Feb 14 15:20:52 UTC 2018


#3301: src/c/src/lib/libbsp/sparc/shared/tmtc/grtc.c:1871]: (style) Suspicious
condition
------------------------------+--------------------
  Reporter:  David Binderman  |      Owner:  (none)
      Type:  defect           |     Status:  new
  Priority:  normal           |  Milestone:
 Component:  admin            |    Version:
  Severity:  normal           |   Keywords:
Blocked By:                   |   Blocking:
------------------------------+--------------------
 src/c/src/lib/libbsp/sparc/shared/tmtc/grtc.c:1871]: (style) Suspicious
 condition (assignment + comparison); Clarify expression with parentheses.

 Source code is

        while ( pDev->running && ((ret=process_dma(pDev) == 2) || (ret ==
 -1)) ) {

 maybe better code

        while ( pDev->running && (((ret = process_dma(pDev)) == 2) || (ret
 == -1)) ) {

--
Ticket URL: <http://devel.rtems.org/ticket/3301>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list