[RTEMS Project] #2711: grtc.c:1840]: (style) Suspicious condition

RTEMS trac trac at rtems.org
Sat May 14 15:28:51 UTC 2016


#2711: grtc.c:1840]: (style) Suspicious condition
---------------------+--------------------
 Reporter:  dcb      |      Owner:
     Type:  defect   |     Status:  new
 Priority:  normal   |  Milestone:  4.11.1
Component:  General  |    Version:  4.10
 Severity:  normal   |   Keywords:
---------------------+--------------------
 rtems/c/src/lib/libbsp/sparc/shared/tmtc/grtc.c:1840]: (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/2711>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list