From: Herbert Poetzl <herbert@13thfloor.at>
To: Linux Kernel ML <linux-kernel@vger.kernel.org>
Subject: [PATCH] genhd: remove useless cast in diskstats_show()
Date: Mon, 13 Jun 2011 13:15:50 +0200 [thread overview]
Message-ID: <20110613111550.GD30072@MAIL.13thfloor.at> (raw)
This patch removes the (unsigned long long) cast in
diskstats_show() and adjusts the seq_printf() format
string to 'unsigned long'
diskstats_show() uses part_stat_read() to get the
stats, which either accesses the specified field in
the struct disk_stats directly (non SMP) or sums
up the per CPU values in a variable of the same
type as the field, so in any case the result will
have the same type and range as the specified field
which for all disk_stats entries is unsigned long
also, for unsigned long ranges the output of %lu
should be identical to the one of %llu, so no change
in the actual proc entry contents
best,
Herbert
Signed-off-by: Herbert Poetzl <herbert@13thfloor.at>
--- linux/block/genhd.c 2011-06-09 15:16:17.000000000 +0200
+++ linux/block/genhd.c 2011-06-13 13:05:56.000000000 +0200
@@ -1154,17 +1154,17 @@ static int diskstats_show(struct seq_fil
cpu = part_stat_lock();
part_round_stats(cpu, hd);
part_stat_unlock();
- seq_printf(seqf, "%4d %7d %s %lu %lu %llu "
- "%u %lu %lu %llu %u %u %u %u\n",
+ seq_printf(seqf, "%4d %7d %s %lu %lu %lu "
+ "%u %lu %lu %lu %u %u %u %u\n",
MAJOR(part_devt(hd)), MINOR(part_devt(hd)),
disk_name(gp, hd->partno, buf),
part_stat_read(hd, ios[READ]),
part_stat_read(hd, merges[READ]),
- (unsigned long long)part_stat_read(hd, sectors[READ]),
+ part_stat_read(hd, sectors[READ]),
jiffies_to_msecs(part_stat_read(hd, ticks[READ])),
part_stat_read(hd, ios[WRITE]),
part_stat_read(hd, merges[WRITE]),
- (unsigned long long)part_stat_read(hd, sectors[WRITE]),
+ part_stat_read(hd, sectors[WRITE]),
jiffies_to_msecs(part_stat_read(hd, ticks[WRITE])),
part_in_flight(hd),
jiffies_to_msecs(part_stat_read(hd, io_ticks)),
next reply other threads:[~2011-06-13 11:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-13 11:15 Herbert Poetzl [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-04-14 1:10 Herbert Poetzl
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=20110613111550.GD30072@MAIL.13thfloor.at \
--to=herbert@13thfloor.at \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®