diff options
author | Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 2008-05-07 23:38:15 +0900 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-06-05 18:13:16 +0100 |
commit | cd9da13d6ef4f4b652a9a885d4a7c80e40fed229 (patch) | |
tree | b7083b8eea03ce4f866c973ccd4504d9823e118c /arch/mips/mm | |
parent | 2cc3c0b67bdde7263f6eb16c16709e0b84047646 (diff) | |
download | op-kernel-dev-cd9da13d6ef4f4b652a9a885d4a7c80e40fed229.zip op-kernel-dev-cd9da13d6ef4f4b652a9a885d4a7c80e40fed229.tar.gz |
Fix divide by zero error in build_clear_page() and build_copy_page()
Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mm')
-rw-r--r-- | arch/mips/mm/page.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/mips/mm/page.c b/arch/mips/mm/page.c index d827d61..cab81f4 100644 --- a/arch/mips/mm/page.c +++ b/arch/mips/mm/page.c @@ -310,8 +310,8 @@ void __cpuinit build_clear_page(void) if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) uasm_i_lui(&buf, AT, 0xa000); - off = min(8, pref_bias_clear_store / cache_line_size) * - cache_line_size; + off = cache_line_size ? min(8, pref_bias_clear_store / cache_line_size) + * cache_line_size : 0; while (off) { build_clear_pref(&buf, -off); off -= cache_line_size; @@ -454,12 +454,14 @@ void __cpuinit build_copy_page(void) if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) uasm_i_lui(&buf, AT, 0xa000); - off = min(8, pref_bias_copy_load / 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_load_pref(&buf, -off); off -= cache_line_size; } - 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; |