linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: 2.5.75 as-iosched.c & asm-generic/div64.h breakage
@ 2003-07-11 21:36 Mikael Pettersson
  2003-07-12 12:31 ` 2.5.75 as-iosched.c & asm-generic/div64.h breakage (PATCH) Bernardo Innocenti
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Pettersson @ 2003-07-11 21:36 UTC (permalink / raw)
  To: akpm, mikpe; +Cc: axboe, bernie, linux-kernel

On Fri, 11 Jul 2003 14:01:58 -0700, Andrew Morton wrote:
> 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.

Apparently. I don't have time for anything but standard kernels.

> 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);

Perhaps, but it's my opinion that do_div() needs to be made more robust,
since arch-specific data abstraction means that callers in generic code
don't always know if some value is u32 or u64.

So your change should be in do_div() itself, not in its callers.

/Mikael

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-07-12 12:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-11 21:36 2.5.75 as-iosched.c & asm-generic/div64.h breakage Mikael Pettersson
2003-07-12 12:31 ` 2.5.75 as-iosched.c & asm-generic/div64.h breakage (PATCH) Bernardo Innocenti

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).