Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/allwinner fix off by one in intr handler



details:   https://anonhg.NetBSD.org/src/rev/5d7a994dc2f8
branches:  trunk
changeset: 802223:5d7a994dc2f8
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Sep 06 12:48:22 2014 +0000

description:
fix off by one in intr handler

diffstat:

 sys/arch/arm/allwinner/awin_dma.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 56e323a4aeff -r 5d7a994dc2f8 sys/arch/arm/allwinner/awin_dma.c
--- a/sys/arch/arm/allwinner/awin_dma.c Sat Sep 06 12:39:27 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_dma.c Sat Sep 06 12:48:22 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_dma.c,v 1.2 2014/09/06 12:39:27 jmcneill Exp $ */
+/* $NetBSD: awin_dma.c,v 1.3 2014/09/06 12:48:22 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "opt_ddb.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: awin_dma.c,v 1.2 2014/09/06 12:39:27 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_dma.c,v 1.3 2014/09/06 12:48:22 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -160,7 +160,7 @@
        while ((bit = ffs(sta & AWIN_DMA_IRQ_END_MASK)) != 0) {
                mask = __BIT(bit - 1);
                sta &= ~mask;
-               index = (bit / 2) & 7;
+               index = ((bit - 1) / 2) & 7;
                if (mask & AWIN_DMA_IRQ_NDMA) {
                        if (awin_ndma_channels[index].ch_callback == NULL)
                                continue;



Home | Main Index | Thread Index | Old Index