linux-mips
[Top] [All Lists]

Re: [PATCH][MIPS] fix divide by zero error in build_clear_page and build

To: yoichi_yuasa@tripeaks.co.jp
Subject: Re: [PATCH][MIPS] fix divide by zero error in build_clear_page and build_copy_page
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Fri, 30 May 2008 13:07:21 +0900 (JST)
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org
In-reply-to: <20080507233815.e6de28da.yoichi_yuasa@tripeaks.co.jp>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20080507233815.e6de28da.yoichi_yuasa@tripeaks.co.jp>
Sender: linux-mips-bounce@linux-mips.org
On Wed, 7 May 2008 23:38:15 +0900, Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 
wrote:
> Fix divide by zero error in build_clear_page() and build_copy_page()
> 
> Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
> 
> diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/mm/page.c 
> linux/arch/mips/mm/page.c
> --- linux-orig/arch/mips/mm/page.c    2008-05-07 10:28:03.732151097 +0900
> +++ linux/arch/mips/mm/page.c 2008-05-07 23:27:00.212977534 +0900
...
> -     off = min(8, pref_bias_copy_store / cache_line_size) * cache_line_size;
> +     off = cache_line_size ? min(8, pref_bias_copy_load / cache_line_size) *
> +                             cache_line_size : 0;
>       while (off) {
>               build_copy_store_pref(&buf, -off);
>               off -= cache_line_size;

This change is wrong.  Please apply this on top of the patch.

diff --git a/arch/mips/mm/page.c b/arch/mips/mm/page.c
index cab81f4..1edf0cb 100644
--- a/arch/mips/mm/page.c
+++ b/arch/mips/mm/page.c
@@ -460,7 +460,7 @@ void __cpuinit build_copy_page(void)
                build_copy_load_pref(&buf, -off);
                off -= cache_line_size;
        }
-       off = cache_line_size ? min(8, pref_bias_copy_load / cache_line_size) *
+       off = cache_line_size ? min(8, pref_bias_copy_store / cache_line_size) *
                                cache_line_size : 0;
        while (off) {
                build_copy_store_pref(&buf, -off);

<Prev in Thread] Current Thread [Next in Thread>