From 84854931140aab6653d22bc1c7fc34641c8e69c1 Mon Sep 17 00:00:00 2001 From: he Date: Mon, 5 Mar 2007 16:41:03 +0000 Subject: [PATCH] Cast to char* before doing pointer arithmetic. --- sys/arch/acorn26/acorn26/pmap.c | 9 +++++---- sys/arch/algor/algor/bus_dma.c | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/arch/acorn26/acorn26/pmap.c b/sys/arch/acorn26/acorn26/pmap.c index 000ad3cb2593..6801edcb8421 100644 --- a/sys/arch/acorn26/acorn26/pmap.c +++ b/sys/arch/acorn26/acorn26/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.15 2007/03/04 05:59:03 christos Exp $ */ +/* $NetBSD: pmap.c,v 1.16 2007/03/05 16:42:38 he Exp $ */ /*- * Copyright (c) 1997, 1998, 2000 Ben Harris * All rights reserved. @@ -102,7 +102,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.15 2007/03/04 05:59:03 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.16 2007/03/05 16:42:38 he Exp $"); #include /* for cold */ #include @@ -300,7 +300,8 @@ pmap_steal_memory(vsize_t size, vaddr_t *vstartp, vaddr_t *vendp) for (i = 0; i < vm_nphysseg; i++) { if (vm_physmem[i].avail_start < vm_physmem[i].avail_end) { addr = (vaddr_t) - (MEMC_PHYS_BASE + ptoa(vm_physmem[i].avail_start)); + ((char*)MEMC_PHYS_BASE + + ptoa(vm_physmem[i].avail_start)); vm_physmem[i].avail_start++; break; } @@ -1062,7 +1063,7 @@ pmap_find(paddr_t pa) if (pv->pv_pmap != NULL && (pv->pv_pmap->pm_flags & PM_ACTIVE)) return (void *)ptoa(pv->pv_lpn); #endif - return MEMC_PHYS_BASE + pa; + return (char*)MEMC_PHYS_BASE + pa; } void diff --git a/sys/arch/algor/algor/bus_dma.c b/sys/arch/algor/algor/bus_dma.c index b1c9799f1052..4f3d93b04e9c 100644 --- a/sys/arch/algor/algor/bus_dma.c +++ b/sys/arch/algor/algor/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.17 2007/03/04 05:59:08 christos Exp $ */ +/* $NetBSD: bus_dma.c,v 1.18 2007/03/05 16:41:03 he Exp $ */ /*- * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.17 2007/03/04 05:59:08 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.18 2007/03/05 16:41:03 he Exp $"); #include #include @@ -742,7 +742,7 @@ _bus_dmamem_mmap(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, continue; } - return (mips_btop((void *)segs[i].ds_addr + off)); + return (mips_btop((char *)segs[i].ds_addr + off)); } /* Page not found. */