From: Andreas Gruenbacher Date: Wed, 26 Aug 2015 16:19:24 +0200 Subject: [Cluster-devel] [PATCH] gfs2: A minor "sbstats" cleanup In-Reply-To: <1440548464.26026.9.camel@decadent.org.uk> References: <1440548464.26026.9.camel@decadent.org.uk> Message-ID: <1440598764-16105-1-git-send-email-agruenba@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit It seems cleaner to avoid the temporary value here. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glock.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 9b6e1a0..f6f51c6 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -1780,7 +1780,6 @@ static int gfs2_sbstats_seq_show(struct seq_file *seq, void *iter_ptr) struct gfs2_sbd *sdp = gi->sdp; unsigned index = gi->hash >> 3; unsigned subindex = gi->hash & 0x07; - u64 value; int i; if (index == 0 && subindex != 0) @@ -1791,12 +1790,12 @@ static int gfs2_sbstats_seq_show(struct seq_file *seq, void *iter_ptr) for_each_possible_cpu(i) { const struct gfs2_pcpu_lkstats *lkstats = per_cpu_ptr(sdp->sd_lkstats, i); - if (index == 0) { - value = i; - } else { - value = lkstats->lkstats[index - 1].stats[subindex]; - } - seq_printf(seq, " %15llu", (long long)value); + + if (index == 0) + seq_printf(seq, " %15u", i); + else + seq_printf(seq, " %15llu", (unsigned long long)lkstats-> + lkstats[index - 1].stats[subindex]); } seq_putc(seq, '\n'); return 0; -- 2.4.3