Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Test the 64bit dma tag with BUS_DMA_TAG_VALID b...



details:   https://anonhg.NetBSD.org/src/rev/00a4a3f120ff
branches:  trunk
changeset: 1015480:00a4a3f120ff
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat Oct 24 08:57:06 2020 +0000

description:
Test the 64bit dma tag with BUS_DMA_TAG_VALID before using it.

diffstat:

 sys/dev/acpi/vmbus_acpi.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 48c2e53ed012 -r 00a4a3f120ff sys/dev/acpi/vmbus_acpi.c
--- a/sys/dev/acpi/vmbus_acpi.c Sat Oct 24 08:56:27 2020 +0000
+++ b/sys/dev/acpi/vmbus_acpi.c Sat Oct 24 08:57:06 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vmbus_acpi.c,v 1.2 2019/05/24 14:28:48 nonaka Exp $    */
+/*     $NetBSD: vmbus_acpi.c,v 1.3 2020/10/24 08:57:06 skrll Exp $     */
 
 /*
  * Copyright (c) 2018 Kimihiro Nonaka <nonaka%NetBSD.org@localhost>
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vmbus_acpi.c,v 1.2 2019/05/24 14:28:48 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vmbus_acpi.c,v 1.3 2020/10/24 08:57:06 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -84,7 +84,8 @@
        sc->sc.sc_dev = self;
        sc->sc.sc_iot = aa->aa_iot;
        sc->sc.sc_memt = aa->aa_memt;
-       sc->sc.sc_dmat = aa->aa_dmat64 ? aa->aa_dmat64 : aa->aa_dmat;
+       sc->sc.sc_dmat = BUS_DMA_TAG_VALID(aa->aa_dmat64) ?
+           aa->aa_dmat64 : aa->aa_dmat;
 
        if (vmbus_attach(&sc->sc))
                return;



Home | Main Index | Thread Index | Old Index