[RTEMS Project] #2726: grascs.c: Questionable use of binary semaphore

RTEMS trac trac at rtems.org
Mon Jun 6 09:02:14 UTC 2016


#2726: grascs.c: Questionable use of binary semaphore
-----------------------------+--------------------
 Reporter:  sebastian.huber  |      Owner:  daniel
     Type:  defect           |     Status:  new
 Priority:  normal           |  Milestone:  4.12
Component:  bsps             |    Version:  4.10
 Severity:  normal           |   Keywords:
-----------------------------+--------------------
 Use a simple binary semaphore or binary semaphore with inherit priority
 instead.

 {{{
 c/src/lib/libbsp/sparc/shared/ascs/grascs.c-
 c/src/lib/libbsp/sparc/shared/ascs/grascs.c-  /* Create semaphores for
 blocking ASCS_TC/TM functions */
 c/src/lib/libbsp/sparc/shared/ascs/grascs.c-
 if(rtems_semaphore_create(rtems_build_name('A','S','C','0'),1,
 c/src/lib/libbsp/sparc/shared/ascs/grascs.c:
 (RTEMS_FIFO|RTEMS_BINARY_SEMAPHORE|
 c/src/lib/libbsp/sparc/shared/ascs/grascs.c-
 RTEMS_NO_INHERIT_PRIORITY|RTEMS_LOCAL|
 c/src/lib/libbsp/sparc/shared/ascs/grascs.c-
 RTEMS_NO_PRIORITY_CEILING), 0,
 c/src/lib/libbsp/sparc/shared/ascs/grascs.c-
 &cfg->tcsem1) != RTEMS_SUCCESSFUL) {
 }}}

 {{{
 c/src/lib/libbsp/sparc/shared/ascs/grascs.c-    goto init_error2;
 c/src/lib/libbsp/sparc/shared/ascs/grascs.c-  }
 c/src/lib/libbsp/sparc/shared/ascs/grascs.c-
 if(rtems_semaphore_create(rtems_build_name('A','S','C','2'),0,
 c/src/lib/libbsp/sparc/shared/ascs/grascs.c:
 (RTEMS_FIFO|RTEMS_BINARY_SEMAPHORE|
 c/src/lib/libbsp/sparc/shared/ascs/grascs.c-
 RTEMS_NO_INHERIT_PRIORITY|RTEMS_LOCAL|
 c/src/lib/libbsp/sparc/shared/ascs/grascs.c-
 RTEMS_NO_PRIORITY_CEILING), 0,
 c/src/lib/libbsp/sparc/shared/ascs/grascs.c-
 &cfg->tcsem2) != RTEMS_SUCCESSFUL) {
 }}}

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


More information about the bugs mailing list