From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>
Subject: [PATCH] contrib/plugins/cache.c: Remove redundant check of l2_access
Date: Thu, 25 Jul 2024 17:48:51 +0100 [thread overview]
Message-ID: <20240725164851.1930964-1-peter.maydell@linaro.org> (raw)
In append_stats_line(), we have an expression
l2_access ? l2_miss_rate : 0.0
But this is inside an if (l2_access && l2_misses) { ... } block,
so Coverity points out that the false part of the ?: is dead code.
Remove the unnecessary test.
Resolves: Coverity CID 1522458
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
contrib/plugins/cache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c
index c5c8ac75a9c..512ef6776b7 100644
--- a/contrib/plugins/cache.c
+++ b/contrib/plugins/cache.c
@@ -558,7 +558,7 @@ static void append_stats_line(GString *line,
" %-12" PRIu64 " %-11" PRIu64 " %10.4lf%%",
l2_access,
l2_misses,
- l2_access ? l2_miss_rate : 0.0);
+ l2_miss_rate);
}
g_string_append(line, "\n");
--
2.34.1
next reply other threads:[~2024-07-25 16:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-25 16:48 Peter Maydell [this message]
2024-07-25 19:55 ` [PATCH] contrib/plugins/cache.c: Remove redundant check of l2_access Philippe Mathieu-Daudé
2024-07-25 20:30 ` Alex Bennée
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=20240725164851.1930964-1-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).