[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/14] contrib/plugins/cache.c: Remove redundant check of l2_acces
From: |
Alex Bennée |
Subject: |
[PULL 11/14] contrib/plugins/cache.c: Remove redundant check of l2_access |
Date: |
Tue, 30 Jul 2024 17:22:34 +0100 |
From: Peter Maydell <peter.maydell@linaro.org>
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>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240725164851.1930964-1-peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240729144414.830369-12-alex.bennee@linaro.org>
diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c
index c5c8ac75a9..512ef6776b 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.39.2
- [PULL 02/14] gitlab: display /packages.txt in build jobs, (continued)
- [PULL 02/14] gitlab: display /packages.txt in build jobs, Alex Bennée, 2024/07/30
- [PULL 03/14] tests/tcg: Use --noexecstack with assembler files, Alex Bennée, 2024/07/30
- [PULL 04/14] tests/tcg/loongarch64: Use --no-warn-rwx-segments to link system tests, Alex Bennée, 2024/07/30
- [PULL 05/14] tests/tcg: update README, Alex Bennée, 2024/07/30
- [PULL 01/14] gitlab: record installed packages in /packages.txt in containers, Alex Bennée, 2024/07/30
- [PULL 07/14] docs/devel: document how to run individual TCG tests, Alex Bennée, 2024/07/30
- [PULL 08/14] tests/avocado: remove tcg_plugins virt_mem_icount test, Alex Bennée, 2024/07/30
- [PULL 12/14] contrib/plugins: be more vocal building, Alex Bennée, 2024/07/30
- [PULL 06/14] docs/devel: update the testing introduction, Alex Bennée, 2024/07/30
- [PULL 13/14] contrib/plugins: add compat for g_memdup2, Alex Bennée, 2024/07/30
- [PULL 11/14] contrib/plugins/cache.c: Remove redundant check of l2_access,
Alex Bennée <=
- [PULL 14/14] plugin/loader: handle basic help query, Alex Bennée, 2024/07/30
- [PULL 09/14] tests/tcg: move test plugins into tcg subdir, Alex Bennée, 2024/07/30
- [PULL 10/14] docs: split TCG plugin usage from devel section, Alex Bennée, 2024/07/30
- Re: [PULL for 9.1-rc1 00/14] Minor bug fixes and documentation cleanups, Richard Henderson, 2024/07/31