Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/arm32 If something goes wrong, we want to retur...



details:   https://anonhg.NetBSD.org/src/rev/2c14c971f0b3
branches:  trunk
changeset: 554525:2c14c971f0b3
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Wed Oct 29 05:03:41 2003 +0000

description:
If something goes wrong, we want to return ENOMEM, not 0!

diffstat:

 sys/arch/arm/arm32/bus_dma.c |  11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diffs (41 lines):

diff -r 5e5ef27d18e5 -r 2c14c971f0b3 sys/arch/arm/arm32/bus_dma.c
--- a/sys/arch/arm/arm32/bus_dma.c      Wed Oct 29 04:58:26 2003 +0000
+++ b/sys/arch/arm/arm32/bus_dma.c      Wed Oct 29 05:03:41 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma.c,v 1.36 2003/10/26 23:11:15 chris Exp $       */
+/*     $NetBSD: bus_dma.c,v 1.37 2003/10/29 05:03:41 mycroft Exp $     */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.36 2003/10/26 23:11:15 chris Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.37 2003/10/29 05:03:41 mycroft Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -673,7 +673,7 @@
     int flags)
 {
        struct arm32_dma_range *dr;
-       int error = 0, i;
+       int error, i;
 
 #ifdef DEBUG_DMA
        printf("dmamem_alloc t=%p size=%lx align=%lx boundary=%lx "
@@ -682,11 +682,10 @@
 #endif
 
        if ((dr = t->_ranges) != NULL) {
+               error = ENOMEM;
                for (i = 0; i < t->_nranges; i++, dr++) {
-                       if (dr->dr_len == 0) {
-                               error = ENOMEM;
+                       if (dr->dr_len == 0)
                                continue;
-                       }
                        error = _bus_dmamem_alloc_range(t, size, alignment,
                            boundary, segs, nsegs, rsegs, flags,
                            trunc_page(dr->dr_sysbase),



Home | Main Index | Thread Index | Old Index