Module Name:    src
Committed By:   uwe
Date:           Thu Mar 17 22:53:13 UTC 2022

Modified Files:
        src/sys/dev/pci: virtio_pci.c

Log Message:
virtio_pci.c: use PCI_BAR macro instead of open-coding it.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/virtio_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/virtio_pci.c
diff -u src/sys/dev/pci/virtio_pci.c:1.34 src/sys/dev/pci/virtio_pci.c:1.35
--- src/sys/dev/pci/virtio_pci.c:1.34	Mon Mar 14 12:22:02 2022
+++ src/sys/dev/pci/virtio_pci.c	Thu Mar 17 22:53:13 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_pci.c,v 1.34 2022/03/14 12:22:02 uwe Exp $ */
+/* $NetBSD: virtio_pci.c,v 1.35 2022/03/17 22:53:13 uwe Exp $ */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.34 2022/03/14 12:22:02 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.35 2022/03/17 22:53:13 uwe Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -439,7 +439,7 @@ virtio_pci_attach_10(device_t self, void
 		pcireg_t type;
 		if (bars[i] == 0)
 			continue;
-		reg = PCI_MAPREG_START + i * 4;
+		reg = PCI_BAR(i);
 		type = pci_mapreg_type(pc, tag, reg);
 		if (pci_mapreg_map(pa, reg, type, 0,
 				&psc->sc_bars_iot[j], &psc->sc_bars_ioh[j],

Reply via email to