cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <andreas.gruenbacher@gmail.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] gfs2: A minor "sbstats" cleanup
Date: Wed, 26 Aug 2015 16:19:24 +0200	[thread overview]
Message-ID: <1440598764-16105-1-git-send-email-agruenba@redhat.com> (raw)
In-Reply-To: <1440548464.26026.9.camel@decadent.org.uk>

It seems cleaner to avoid the temporary value here.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 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



      parent reply	other threads:[~2015-08-26 14:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26  0:21 [Cluster-devel] [PATCH] gfs2: Make statistics unsigned, suitable for use with do_div() Ben Hutchings
2015-08-26 13:58 ` Andreas Gruenbacher
2015-08-26 14:08 ` Andreas Gruenbacher
2015-08-26 14:19 ` Andreas Gruenbacher [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440598764-16105-1-git-send-email-agruenba@redhat.com \
    --to=andreas.gruenbacher@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).