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/8cebf9afea2a
branches:  trunk
changeset: 944491:8cebf9afea2a
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 428d34913af8 -r 8cebf9afea2a 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