From 1084c3763623940bfa9d89601cbd6d4945f55466 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Wed, 22 Feb 2023 18:18:41 +0100 Subject: [PATCH] Remove conditions which are always true Signed-off-by: Sebastien GODARD --- iostat.c | 2 +- pr_stats.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/iostat.c b/iostat.c index 4c08d6c..15bcbbc 100644 --- a/iostat.c +++ b/iostat.c @@ -2033,7 +2033,7 @@ void rw_io_stat_loop(long int count, struct tm *rectime) /* SIGINT signal caught => Terminate JSON output properly */ count = 0; } - else if (DISPLAY_JSON_OUTPUT(flags) && count && !skip) { + else if (DISPLAY_JSON_OUTPUT(flags) && !skip) { /* count != 0 */ printf(","); } skip = 0; diff --git a/pr_stats.c b/pr_stats.c index 665ada1..8fe04ec 100644 --- a/pr_stats.c +++ b/pr_stats.c @@ -2836,8 +2836,11 @@ __print_funct_t stub_print_filesystem_stats(struct activity *a, int prev, int cu } } - if (!DISPLAY_ZERO_OMIT(flags) || dispavg || WANT_SINCE_BOOT(flags) || !found || - (found && memcmp(sfp, sfc, STATS_FILESYSTEM_SIZE2CMP))) { + if (!DISPLAY_ZERO_OMIT(flags) || dispavg + || WANT_SINCE_BOOT(flags) + || !found + /* found is true */ + || memcmp(sfp, sfc, STATS_FILESYSTEM_SIZE2CMP)) { printf("%-11s", (dispavg ? _("Summary:") : timestamp[curr])); cprintf_f(unit, FALSE, 2, 9, 0, -- 2.40.0