diff options
author | bket <bket@cvs.openbsd.org> | 2020-06-27 07:20:58 +0000 |
---|---|---|
committer | bket <bket@cvs.openbsd.org> | 2020-06-27 07:20:58 +0000 |
commit | 2587f6fc2ef584d255d0d34c9f9acbb5193ab48c (patch) | |
tree | 0aa2ca6b39fb7a49e5672b76bbb7cfd0de47e41a | |
parent | bec048f0cce62133948e8b1e63933aeb582a65d1 (diff) |
Replace TAILQ concatenation loop with TAILQ_CONCAT
As a result remove unneeded variable
OK kn@, millert@
-rw-r--r-- | sys/dev/pv/viomb.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/dev/pv/viomb.c b/sys/dev/pv/viomb.c index 8e486476a6c..d71f4e47226 100644 --- a/sys/dev/pv/viomb.c +++ b/sys/dev/pv/viomb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: viomb.c,v 1.5 2019/05/26 15:20:04 sf Exp $ */ +/* $OpenBSD: viomb.c,v 1.6 2020/06/27 07:20:57 bket Exp $ */ /* $NetBSD: viomb.c,v 1.1 2011/10/30 12:12:21 hannken Exp $ */ /* @@ -418,7 +418,6 @@ viomb_inflate_intr(struct virtqueue *vq) struct virtio_softc *vsc = vq->vq_owner; struct viomb_softc *sc = (struct viomb_softc *)vsc->sc_child; struct balloon_req *b; - struct vm_page *p; u_int64_t nvpages; if (viomb_vq_dequeue(vq)) @@ -429,11 +428,7 @@ viomb_inflate_intr(struct virtqueue *vq) bus_dmamap_sync(vsc->sc_dmat, b->bl_dmamap, 0, sizeof(u_int32_t) * nvpages, BUS_DMASYNC_POSTWRITE); - while (!TAILQ_EMPTY(&b->bl_pglist)) { - p = TAILQ_FIRST(&b->bl_pglist); - TAILQ_REMOVE(&b->bl_pglist, p, pageq); - TAILQ_INSERT_TAIL(&sc->sc_balloon_pages, p, pageq); - } + TAILQ_CONCAT(&sc->sc_balloon_pages, &b->bl_pglist, pageq); VIOMBDEBUG(sc, "updating sc->sc_actual from %u to %llu\n", sc->sc_actual, sc->sc_actual + nvpages); virtio_write_device_config_4(vsc, VIRTIO_BALLOON_CONFIG_ACTUAL, |