Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/broadcom Fix off-by-one in channel count, from ...



details:   https://anonhg.NetBSD.org/src/rev/bf0c81d0968e
branches:  trunk
changeset: 955479:bf0c81d0968e
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Sep 30 23:58:13 2020 +0000

description:
Fix off-by-one in channel count, from Mark Millard.

diffstat:

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

diffs (27 lines):

diff -r 38a86bd68d74 -r bf0c81d0968e sys/arch/arm/broadcom/bcm2835_dmac.c
--- a/sys/arch/arm/broadcom/bcm2835_dmac.c      Wed Sep 30 20:20:53 2020 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_dmac.c      Wed Sep 30 23:58:13 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_dmac.c,v 1.16 2017/12/10 21:38:26 skrll Exp $ */
+/* $NetBSD: bcm2835_dmac.c,v 1.17 2020/09/30 23:58:13 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: bcm2835_dmac.c,v 1.16 2017/12/10 21:38:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_dmac.c,v 1.17 2020/09/30 23:58:13 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -142,7 +142,7 @@
 
        mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_SCHED);
 
-       sc->sc_nchannels = 31 - __builtin_clz(sc->sc_channelmask);
+       sc->sc_nchannels = 32 - __builtin_clz(sc->sc_channelmask);
        sc->sc_channels = kmem_alloc(
            sizeof(*sc->sc_channels) * sc->sc_nchannels, KM_SLEEP);
 



Home | Main Index | Thread Index | Old Index