From: Andrew Morton <akpm@osdl.org>
To: Mikael Pettersson <mikpe@csd.uu.se>
Cc: axboe@suse.de, bernie@develer.com, linux-kernel@vger.kernel.org
Subject: Re: 2.5.75 as-iosched.c & asm-generic/div64.h breakage
Date: Fri, 11 Jul 2003 14:01:58 -0700 [thread overview]
Message-ID: <20030711140158.0b27117e.akpm@osdl.org> (raw)
In-Reply-To: <200307112048.h6BKmUQj003987@harpo.it.uu.se>
Mikael Pettersson <mikpe@csd.uu.se> wrote:
>
> drivers/block/as-iosched.c: In function `as_update_iohist':
> drivers/block/as-iosched.c:840: warning: right shift count >= width of type
> drivers/block/as-iosched.c:840: warning: passing arg 1 of `__div64_32' from incompatible pointer type
You mean that code was in -mm for all those months and no ppc32 person
bothered testing it? Bah.
Something like this? (Could be sped up for 32-bit sector_t)
diff -puN drivers/block/as-iosched.c~as-do_div-fix drivers/block/as-iosched.c
--- 25/drivers/block/as-iosched.c~as-do_div-fix Fri Jul 11 14:00:55 2003
+++ 25-akpm/drivers/block/as-iosched.c Fri Jul 11 14:00:58 2003
@@ -836,8 +836,10 @@ static void as_update_iohist(struct as_i
aic->seek_samples += 256;
aic->seek_total += 256*seek_dist;
if (aic->seek_samples) {
- aic->seek_mean = aic->seek_total + 128;
- do_div(aic->seek_mean, aic->seek_samples);
+ u64 seek_mean = aic->seek_total + 128;
+
+ do_div(seek_mean, aic->seek_samples);
+ aic->seek_mean = seek_mean;
}
aic->seek_samples = (aic->seek_samples>>1)
+ (aic->seek_samples>>2);
_
next prev parent reply other threads:[~2003-07-11 20:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-11 20:48 2.5.75 as-iosched.c & asm-generic/div64.h breakage Mikael Pettersson
2003-07-11 21:01 ` Andrew Morton [this message]
2003-07-12 0:49 ` Paul Mackerras
2003-07-12 1:03 ` Nick Piggin
2003-07-14 4:10 ` Peter Chubb
2003-07-11 21:36 Mikael Pettersson
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=20030711140158.0b27117e.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=axboe@suse.de \
--cc=bernie@develer.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikpe@csd.uu.se \
/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).