From: Colin Ian King <colin.king@canonical.com>
To: Tom Zanussi <zanussi@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: re: tracing: Add support for dynamic strings to synthetic events
Date: Wed, 7 Oct 2020 14:08:38 +0100 [thread overview]
Message-ID: <d34dccd5-96ba-a2d9-46ea-de8807525deb@canonical.com> (raw)
Hi,
Static analysis with Coverity has detected a duplicated condition in an
if statement in the following commit in source
kernel/trace/trace_events_synth.c
commit bd82631d7ccdc894af2738e47abcba2cb6e7dea9
Author: Tom Zanussi <zanussi@kernel.org>
Date: Sun Oct 4 17:14:06 2020 -0500
tracing: Add support for dynamic strings to synthetic events
Analysis is as follows:
493 for (i = 0; i < event->n_fields; i++) {
Same on both sides (CONSTANT_EXPRESSION_RESULT)
pointless_expression: The expression event->fields[i]->is_dynamic &&
event->fields[i]->is_dynamic does not accomplish anything because it
evaluates to either of its identical operands, event->fields[i]->is_dynamic.
Did you intend the operands to be different?
494 if (event->fields[i]->is_dynamic &&
495 event->fields[i]->is_dynamic)
496 pos += snprintf(buf + pos, LEN_OR_ZERO,
497 ", __get_str(%s)",
event->fields[i]->name);
498 else
499 pos += snprintf(buf + pos, LEN_OR_ZERO,
500 ", REC->%s",
event->fields[i]->name);
501 }
Colin
next reply other threads:[~2020-10-07 13:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-07 13:08 Colin Ian King [this message]
2020-10-07 13:30 ` Steven Rostedt
2020-10-07 13:35 ` Colin Ian King
2020-10-07 14:27 ` Tom Zanussi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d34dccd5-96ba-a2d9-46ea-de8807525deb@canonical.com \
--to=colin.king@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=zanussi@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®