From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Wed, 2 Sep 2015 15:02:26 -0500 Subject: [Cluster-devel] [PATCH 6/6] gfs2: A minor "sbstats" cleanup In-Reply-To: <1441224146-14737-1-git-send-email-rpeterso@redhat.com> References: <1441224146-14737-1-git-send-email-rpeterso@redhat.com> Message-ID: <1441224146-14737-7-git-send-email-rpeterso@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit From: Andreas Gruenbacher It seems cleaner to avoid the temporary value here. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson --- 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 37d4db1..9bd1244 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -1727,7 +1727,6 @@ static int gfs2_sbstats_seq_show(struct seq_file *seq, void *iter_ptr) loff_t pos = *(loff_t *)iter_ptr; unsigned index = pos >> 3; unsigned subindex = pos & 0x07; - u64 value; int i; if (index == 0 && subindex != 0) @@ -1738,12 +1737,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