Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbppc/mpc85xx Suppress a GCC 4.5 warning.



details:   https://anonhg.NetBSD.org/src/rev/8584ce9015b9
branches:  trunk
changeset: 767505:8584ce9015b9
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Jul 20 13:21:12 2011 +0000

description:
Suppress a GCC 4.5 warning.

diffstat:

 sys/arch/evbppc/mpc85xx/machdep.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (34 lines):

diff -r 52586b0aa649 -r 8584ce9015b9 sys/arch/evbppc/mpc85xx/machdep.c
--- a/sys/arch/evbppc/mpc85xx/machdep.c Wed Jul 20 13:20:26 2011 +0000
+++ b/sys/arch/evbppc/mpc85xx/machdep.c Wed Jul 20 13:21:12 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.18 2011/07/17 20:54:39 joerg Exp $       */
+/*     $NetBSD: machdep.c,v 1.19 2011/07/20 13:21:12 matt Exp $        */
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -122,8 +122,8 @@
 void   initppc(vaddr_t, vaddr_t, void *, void *, void *, void *);
 
 #define        MEMREGIONS      4
-phys_ram_seg_t physmemr[MEMREGIONS];         /* All memory */
-phys_ram_seg_t availmemr[MEMREGIONS];        /* Available memory */
+phys_ram_seg_t physmemr[MEMREGIONS];           /* All memory */
+phys_ram_seg_t availmemr[2*MEMREGIONS];                /* Available memory */
 static u_int nmemr;
 
 #ifndef CONSFREQ
@@ -536,9 +536,10 @@
        /*
         * Steal pages at the end of memory for the kernel message buffer.
         */
-       availmemr[cnt-1].size -= round_page(MSGBUFSIZE);
-       msgbuf_paddr =
-           (uintptr_t)(availmemr[cnt-1].start + availmemr[cnt-1].size);
+       mr = availmemr + cnt - 1;
+       KASSERT(mr->size >= round_page(MSGBUFSIZE));
+       mr->size -= round_page(MSGBUFSIZE);
+       msgbuf_paddr = (uintptr_t)(mr->start + mr->size);
 
        /*
         * Calculate physmem.



Home | Main Index | Thread Index | Old Index