Source-Changes-HG archive

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

[src/trunk]: src/sys Fix round_blocksize not to return 0.



details:   https://anonhg.NetBSD.org/src/rev/50bebac4b24e
branches:  trunk
changeset: 930973:50bebac4b24e
user:      isaki <isaki%NetBSD.org@localhost>
date:      Sun Apr 19 08:18:19 2020 +0000

description:
Fix round_blocksize not to return 0.

diffstat:

 sys/arch/arm/imx/imx23_digfilt.c  |  4 +++-
 sys/arch/arm/xscale/pxa2x0_ac97.c |  7 +++++--
 sys/dev/pci/auvia.c               |  9 ++++++---
 sys/dev/pci/esm.c                 |  6 ++++--
 sys/dev/pci/sv.c                  |  9 ++++++---
 5 files changed, 24 insertions(+), 11 deletions(-)

diffs (126 lines):

diff -r b478e95b805f -r 50bebac4b24e sys/arch/arm/imx/imx23_digfilt.c
--- a/sys/arch/arm/imx/imx23_digfilt.c  Sun Apr 19 04:13:09 2020 +0000
+++ b/sys/arch/arm/imx/imx23_digfilt.c  Sun Apr 19 08:18:19 2020 +0000
@@ -1,4 +1,4 @@
-/* $Id: imx23_digfilt.c,v 1.2 2019/05/08 13:40:14 isaki Exp $ */
+/* $Id: imx23_digfilt.c,v 1.3 2020/04/19 08:18:19 isaki Exp $ */
 
 /*
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -380,6 +380,8 @@
                blocksize = DIGFILT_BLOCKSIZE_MAX;
        else
                blocksize = bs & ~(DIGFILT_BLOCKSIZE_ROUND-1);
+       if (blocksize < DIGFILT_BLOCKSIZE_ROUND)
+               blocksize = DIGFILT_BLOCKSIZE_ROUND;
 
        return blocksize;
 }
diff -r b478e95b805f -r 50bebac4b24e sys/arch/arm/xscale/pxa2x0_ac97.c
--- a/sys/arch/arm/xscale/pxa2x0_ac97.c Sun Apr 19 04:13:09 2020 +0000
+++ b/sys/arch/arm/xscale/pxa2x0_ac97.c Sun Apr 19 08:18:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pxa2x0_ac97.c,v 1.17 2019/06/08 08:02:37 isaki Exp $   */
+/*     $NetBSD: pxa2x0_ac97.c,v 1.18 2020/04/19 08:18:19 isaki Exp $   */
 
 /*
  * Copyright (c) 2003, 2005 Wasabi Systems, Inc.
@@ -593,7 +593,10 @@
 acu_round_blocksize(void *arg, int blk, int mode, const audio_params_t *param)
 {
 
-       return (blk & ~0x1f);
+       blk = (blk & ~0x1f);
+       if (blk < 0x20)
+               blk = 0x20;
+       return blk;
 }
 
 static int
diff -r b478e95b805f -r 50bebac4b24e sys/dev/pci/auvia.c
--- a/sys/dev/pci/auvia.c       Sun Apr 19 04:13:09 2020 +0000
+++ b/sys/dev/pci/auvia.c       Sun Apr 19 08:18:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auvia.c,v 1.85 2020/02/28 13:31:03 isaki Exp $ */
+/*     $NetBSD: auvia.c,v 1.86 2020/04/19 08:18:19 isaki Exp $ */
 
 /*-
  * Copyright (c) 2000, 2008 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auvia.c,v 1.85 2020/02/28 13:31:03 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auvia.c,v 1.86 2020/04/19 08:18:19 isaki Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -749,7 +749,10 @@
        if (sc->sc_flags & AUVIA_FLAGS_VT8233 && blk < 288)
                blk = 288;
 
-       return (blk & -32);
+       blk = (blk & -32);
+       if (blk < 32)
+               blk = 32;
+       return blk;
 }
 
 static int
diff -r b478e95b805f -r 50bebac4b24e sys/dev/pci/esm.c
--- a/sys/dev/pci/esm.c Sun Apr 19 04:13:09 2020 +0000
+++ b/sys/dev/pci/esm.c Sun Apr 19 08:18:19 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: esm.c,v 1.64 2019/10/05 01:30:28 mrg Exp $      */
+/*      $NetBSD: esm.c,v 1.65 2020/04/19 08:18:19 isaki Exp $      */
 
 /*-
  * Copyright (c) 2002, 2003 Matt Fredette
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: esm.c,v 1.64 2019/10/05 01:30:28 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esm.c,v 1.65 2020/04/19 08:18:19 isaki Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1186,6 +1186,8 @@
            ("esm_round_blocksize(%p, 0x%x)", sc, blk));
 
        blk &= ~0x3f;           /* keep good alignment */
+       if (blk < 0x40)
+               blk = 0x40;
 
        DPRINTF(ESM_DEBUG_PARAM, (" = 0x%x\n", blk));
 
diff -r b478e95b805f -r 50bebac4b24e sys/dev/pci/sv.c
--- a/sys/dev/pci/sv.c  Sun Apr 19 04:13:09 2020 +0000
+++ b/sys/dev/pci/sv.c  Sun Apr 19 08:18:19 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: sv.c,v 1.57 2019/10/28 18:38:43 joerg Exp $ */
+/*      $NetBSD: sv.c,v 1.58 2020/04/19 08:18:19 isaki Exp $ */
 /*      $OpenBSD: sv.c,v 1.2 1998/07/13 01:50:15 csapuntz Exp $ */
 
 /*
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sv.c,v 1.57 2019/10/28 18:38:43 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sv.c,v 1.58 2020/04/19 08:18:19 isaki Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -679,7 +679,10 @@
     const audio_params_t *param)
 {
 
-       return blk & -32;       /* keep good alignment */
+       blk = blk & -32;        /* keep good alignment */
+       if (blk < 32)
+               blk = 32;
+       return blk;
 }
 
 static int



Home | Main Index | Thread Index | Old Index