From 0c51fa10d3b36eb9810d219a273738f02e56783f Mon Sep 17 00:00:00 2001 From: Henri Doreau Date: Thu, 2 Jun 2016 13:47:31 +0200 Subject: [PATCH 1/1] LU-8232 obdclass: remove dead code No need to check for rc since it is never assigned after declaration and sub-calls do not return error codes. Test-Parameters: trivial Change-Id: I040a45e8a779b11840c8c883fd4d5d87ee7f0fed Signed-off-by: Henri Doreau Reviewed-on: http://review.whamcloud.com/20587 Reviewed-by: Ben Evans Reviewed-by: James Simmons Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Emoly Liu Reviewed-by: Oleg Drokin --- lustre/obdclass/lprocfs_status.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index c68bb31..7d7299c 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -1270,7 +1270,6 @@ static int lprocfs_stats_seq_show(struct seq_file *p, void *v) struct lprocfs_counter_header *hdr; struct lprocfs_counter ctr; int idx = *(loff_t *)v; - int rc = 0; if (idx == 0) { struct timeval now; @@ -1278,34 +1277,25 @@ static int lprocfs_stats_seq_show(struct seq_file *p, void *v) do_gettimeofday(&now); seq_printf(p, "%-25s %lu.%lu secs.usecs\n", "snapshot_time", now.tv_sec, now.tv_usec); - if (rc < 0) - return rc; } hdr = &stats->ls_cnt_header[idx]; lprocfs_stats_collect(stats, idx, &ctr); if (ctr.lc_count == 0) - goto out; + return 0; seq_printf(p, "%-25s "LPD64" samples [%s]", hdr->lc_name, ctr.lc_count, hdr->lc_units); - if (rc < 0) - goto out; if ((hdr->lc_config & LPROCFS_CNTR_AVGMINMAX) && ctr.lc_count > 0) { seq_printf(p, " "LPD64" "LPD64" "LPD64, ctr.lc_min, ctr.lc_max, ctr.lc_sum); - if (rc < 0) - goto out; if (hdr->lc_config & LPROCFS_CNTR_STDDEV) seq_printf(p, " "LPD64, ctr.lc_sumsquare); - if (rc < 0) - goto out; } seq_putc(p, '\n'); -out: - return (rc < 0) ? rc : 0; + return 0; } static const struct seq_operations lprocfs_stats_seq_sops = { -- 1.8.3.1