Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/acorn26/acorn26 Put proper casts to address range c...



details:   https://anonhg.NetBSD.org/src/rev/a5deb0203edf
branches:  trunk
changeset: 766101:a5deb0203edf
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Wed Jun 15 15:03:51 2011 +0000

description:
Put proper casts to address range checks.

diffstat:

 sys/arch/acorn26/acorn26/machdep.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 4009980febb8 -r a5deb0203edf sys/arch/acorn26/acorn26/machdep.c
--- a/sys/arch/acorn26/acorn26/machdep.c        Wed Jun 15 14:47:43 2011 +0000
+++ b/sys/arch/acorn26/acorn26/machdep.c        Wed Jun 15 15:03:51 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.34 2011/06/12 03:35:36 rmind Exp $ */
+/* $NetBSD: machdep.c,v 1.35 2011/06/15 15:03:51 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1998 Ben Harris
@@ -32,7 +32,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.34 2011/06/12 03:35:36 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.35 2011/06/15 15:03:51 tsutsui Exp $");
 
 #include <sys/buf.h>
 #include <sys/kernel.h>
@@ -217,7 +217,7 @@
 mm_md_physacc(paddr_t pa, vm_prot_t prot)
 {
 
-       return (pa > MEMC_PHYS_BASE + ptoa(physmem)) ? EFAULT : 0;
+       return (pa > (paddr_t)MEMC_PHYS_BASE + ptoa(physmem)) ? EFAULT : 0;
 }
 
 int
@@ -225,6 +225,7 @@
 {
        const vaddr_t v = (vaddr_t)ptr;
 
-       *handled = (v >= MEMC_PHYS_BASE && v < MEMC_PHYS_BASE + ptoa(physmem));
+       *handled = (v >= (vaddr_t)MEMC_PHYS_BASE &&
+           v < (vaddr_t)MEMC_PHYS_BASE + ptoa(physmem));
        return 0;
 }



Home | Main Index | Thread Index | Old Index