Module Name: src Committed By: skrll Date: Mon Oct 17 07:03:19 UTC 2022
Modified Files: src/sys/dev/pci: virtio.c Log Message: Fix previous by using roundup (and not howmany). To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/sys/dev/pci/virtio.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.c diff -u src/sys/dev/pci/virtio.c:1.60 src/sys/dev/pci/virtio.c:1.61 --- src/sys/dev/pci/virtio.c:1.60 Sat Oct 15 19:55:37 2022 +++ src/sys/dev/pci/virtio.c Mon Oct 17 07:03:19 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: virtio.c,v 1.60 2022/10/15 19:55:37 riastradh Exp $ */ +/* $NetBSD: virtio.c,v 1.61 2022/10/17 07:03:19 skrll Exp $ */ /* * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.60 2022/10/15 19:55:37 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.61 2022/10/17 07:03:19 skrll Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -760,7 +760,7 @@ virtio_alloc_vq(struct virtio_softc *sc, { int vq_size, allocsize1, allocsize2, allocsize3, allocsize = 0; int rsegs, r, hdrlen; -#define VIRTQUEUE_ALIGN(n) howmany(n, VIRTIO_PAGE_SIZE) +#define VIRTQUEUE_ALIGN(n) roundup(n, VIRTIO_PAGE_SIZE) /* Make sure callers allocate vqs in order */ KASSERT(sc->sc_nvqs == index);