cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 6/6] gfs2: A minor "sbstats" cleanup
Date: Wed,  2 Sep 2015 15:02:26 -0500	[thread overview]
Message-ID: <1441224146-14737-7-git-send-email-rpeterso@redhat.com> (raw)
In-Reply-To: <1441224146-14737-1-git-send-email-rpeterso@redhat.com>

From: Andreas Gruenbacher <agruenba@redhat.com>

It seems cleaner to avoid the temporary value here.

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



  parent reply	other threads:[~2015-09-02 20:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02 20:02 [Cluster-devel] [PATCH 0/6] GFS2: Pre-pull patch posting (merge window) Bob Peterson
2015-09-02 20:02 ` [Cluster-devel] [PATCH 1/6] gfs2: Simplify the seq file code for "sbstats" Bob Peterson
2015-09-02 20:02 ` [Cluster-devel] [PATCH 2/6] GFS2: Move glock superblock pointer to field gl_name Bob Peterson
2015-09-03 14:38   ` Andreas Gruenbacher
2015-09-02 20:02 ` [Cluster-devel] [PATCH 3/6] GFS2: Use resizable hash table for glocks Bob Peterson
2015-09-03 14:39   ` Andreas Gruenbacher
2015-09-02 20:02 ` [Cluster-devel] [PATCH 4/6] gfs2: Make statistics unsigned, suitable for use with do_div() Bob Peterson
2015-09-03 14:39   ` Andreas Gruenbacher
2015-09-02 20:02 ` [Cluster-devel] [PATCH 5/6] gfs2: Fix a typo in a comment Bob Peterson
2015-09-02 20:02 ` Bob Peterson [this message]
2015-09-03 14:45 ` [Cluster-devel] [PATCH 0/6] GFS2: Pre-pull patch posting (merge window) Andreas Gruenbacher

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=1441224146-14737-7-git-send-email-rpeterso@redhat.com \
    --to=rpeterso@redhat.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).