aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--idlestat.c8
-rw-r--r--reports.c8
2 files changed, 16 insertions, 0 deletions
diff --git a/idlestat.c b/idlestat.c
index 39998c3..4392920 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -900,6 +900,14 @@ struct cpuidle_datas *idlestat_load(const char *filename)
const struct trace_ops **ops_it;
int ret;
+ /*
+ * The linker places pointers to all entries declared with
+ * EXPORT_TRACE_OPS into a special segment. This creates
+ * an array of pointers preceded by trace_ops_head. Let
+ * the static analysis tool know that we know what we are
+ * doing.
+ */
+ /* coverity[array_vs_singleton] */
for (ops_it = (&trace_ops_head)+1 ; *ops_it ; ++ops_it) {
assert((*ops_it)->name);
assert((*ops_it)->check_magic);
diff --git a/reports.c b/reports.c
index 7784cd6..5140b5b 100644
--- a/reports.c
+++ b/reports.c
@@ -34,6 +34,14 @@ void list_report_formats_to_stderr(void)
{
const struct report_ops **ops_it;
+ /*
+ * The linker places pointers to all entries declared with
+ * EXPORT_REPORT_OPS into a special segment. This creates
+ * an array of pointers preceded by report_ops_head. Let
+ * the static analysis tool know that we know what we are
+ * doing.
+ */
+ /* coverity[array_vs_singleton] */
for (ops_it = (&report_ops_head)+1 ; *ops_it ; ++ops_it)
fprintf(stderr, " %s", (*ops_it)->name);