diff options
author | Tuukka Tikkanen <tuukka.tikkanen@linaro.org> | 2015-01-13 20:39:33 +0200 |
---|---|---|
committer | Tuukka Tikkanen <tuukka.tikkanen@linaro.org> | 2015-01-13 20:39:33 +0200 |
commit | 9477d3598858225dfac6e1981060c8f8d078af84 (patch) | |
tree | 53be92e9ad4dcf26b78f8197f106e573721aedef /idlestat.c | |
parent | 514c7c7ebd636a28c00f745fcd10142cbb369fc0 (diff) |
Idlestat: Suppress static analysis false positives
The report_ops and trace_ops arrays are created by the linker.
Static analysis tool has no idea of this and make a false positive
detection for the loops that access the arrays. This patch
introduces comments that suppress the detection for the
lines in question.
Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
Diffstat (limited to 'idlestat.c')
-rw-r--r-- | idlestat.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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); |