Bug Summary

File:/home/joel/rtems-4.11-work/build/rtems/c/src/../../cpukit/libmisc/monitor/mon-sema.c
Location:line 82, column 5
Description:Value stored to 'length' is never read

Annotated Source Code

1/*
2 * RTEMS Monitor semaphore support
3 *
4 * $Id: mon-sema.c,v 1.6 2009/11/29 12:12:39 ralf Exp $
5 */
6
7#ifdef HAVE_CONFIG_H1
8#include "config.h"
9#endif
10
11#include <rtems.h>
12#include "monitor.h"
13#include <rtems/rtems/attr.inl>
14#include <stdio.h>
15#include <string.h> /* memcpy() */
16
17void
18rtems_monitor_sema_canonical(
19 rtems_monitor_sema_t *canonical_sema,
20 void *sema_void
21)
22{
23 Semaphore_Control *rtems_sema = (Semaphore_Control *) sema_void;
24
25 canonical_sema->attribute = rtems_sema->attribute_set;
26 canonical_sema->priority_ceiling =
27 rtems_sema->Core_control.mutex.Attributes.priority_ceiling;
28
29 canonical_sema->holder_id =
30 rtems_sema->Core_control.mutex.holder_id;
31
32 if (_Attributes_Is_counting_semaphore(canonical_sema->attribute)) {
33 /* we have a counting semaphore */
34 canonical_sema->cur_count =
35 rtems_sema->Core_control.semaphore.count;
36
37 canonical_sema->max_count =
38 rtems_sema->Core_control.semaphore.Attributes.maximum_count;
39 }
40 else {
41 /* we have a binary semaphore (mutex) */
42 canonical_sema->cur_count = rtems_sema->Core_control.mutex.lock;
43 canonical_sema->max_count = 1; /* mutex is either 0 or 1 */
44 }
45}
46
47
48void
49rtems_monitor_sema_dump_header(
50 bool_Bool verbose __attribute__((unused))
51)
52{
53 printf("\
54 ID NAME ATTR PRICEIL CURR_CNT HOLDID \n");
55/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 1234
56 1 2 3 4 5 6 7 */
57
58 rtems_monitor_separator();
59}
60
61/*
62 */
63
64void
65rtems_monitor_sema_dump(
66 rtems_monitor_sema_t *monitor_sema,
67 bool_Bool verbose __attribute__((unused))
68)
69{
70 int length = 0;
71
72 length += rtems_monitor_dump_id(monitor_sema->id);
73 length += rtems_monitor_pad(11, length);
74 length += rtems_monitor_dump_name(monitor_sema->id);
75 length += rtems_monitor_pad(18, length);
76 length += rtems_monitor_dump_attributes(monitor_sema->attribute);
77 length += rtems_monitor_pad(30, length);
78 length += rtems_monitor_dump_priority(monitor_sema->priority_ceiling);
79 length += rtems_monitor_pad(38, length);
80 length += rtems_monitor_dump_decimal(monitor_sema->cur_count);
81 length += rtems_monitor_pad(47, length);
82 length += rtems_monitor_dump_id(monitor_sema->holder_id);
Value stored to 'length' is never read
83 printf("\n");
84}