Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hp700/hp700 Just return if length of zero is passed...



details:   https://anonhg.NetBSD.org/src/rev/dd98529f3f53
branches:  trunk
changeset: 752071:dd98529f3f53
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Feb 12 22:23:40 2010 +0000

description:
Just return if length of zero is passed to bus_dmamap_sync.

diffstat:

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

diffs (44 lines):

diff -r 6af132bd22eb -r dd98529f3f53 sys/arch/hp700/hp700/mainbus.c
--- a/sys/arch/hp700/hp700/mainbus.c    Fri Feb 12 22:23:17 2010 +0000
+++ b/sys/arch/hp700/hp700/mainbus.c    Fri Feb 12 22:23:40 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mainbus.c,v 1.58 2009/12/02 13:49:32 skrll Exp $       */
+/*     $NetBSD: mainbus.c,v 1.59 2010/02/12 22:23:40 skrll Exp $       */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.58 2009/12/02 13:49:32 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.59 2010/02/12 22:23:40 skrll Exp $");
 
 #include "locators.h"
 #include "power.h"
@@ -1101,6 +1101,7 @@
     int ops)
 {
        int i;
+
        /*
         * Mixing of PRE and POST operations is not allowed.
         */
@@ -1112,7 +1113,7 @@
        if (offset >= map->dm_mapsize)
                panic("mbus_dmamap_sync: bad offset %lu (map size is %lu)",
                    offset, map->dm_mapsize);
-       if (len == 0 || (offset + len) > map->dm_mapsize)
+       if ((offset + len) > map->dm_mapsize)
                panic("mbus_dmamap_sync: bad length");
 #endif
 
@@ -1133,7 +1134,7 @@
         */
 
        ops &= (BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
-       if (ops == 0)
+       if (len == 0 || ops == 0)
                return;
 
        for (i = 0; len != 0 && i < map->dm_nsegs; i++) {



Home | Main Index | Thread Index | Old Index