diff options
author | 2020-06-27 13:37:51 +0000 | |
---|---|---|
committer | 2020-06-27 13:37:51 +0000 | |
commit | bab068e9127204020931adb883c561f00261aa79 (patch) | |
tree | 1b6c3db140c02a8817007d80efaa4b4491fed604 | |
parent | Replace TAILQ concatenation loop with TAILQ_CONCAT (diff) | |
download | wireguard-openbsd-bab068e9127204020931adb883c561f00261aa79.tar.xz wireguard-openbsd-bab068e9127204020931adb883c561f00261aa79.zip |
Replace TAILQ concatenation loop with TAILQ_CONCAT
While here remove some whitespace.
OK millert@
-rw-r--r-- | sys/dev/pci/qle.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/sys/dev/pci/qle.c b/sys/dev/pci/qle.c index ea2dba1074a..884131d5113 100644 --- a/sys/dev/pci/qle.c +++ b/sys/dev/pci/qle.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qle.c,v 1.53 2020/06/24 18:59:30 krw Exp $ */ +/* $OpenBSD: qle.c,v 1.54 2020/06/27 13:37:51 bket Exp $ */ /* * Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org> @@ -1044,7 +1044,7 @@ qle_handle_resp(struct qle_softc *sc, u_int32_t id) ccb = NULL; entry = QLE_DMA_KVA(sc->sc_responses) + (id * QLE_QUEUE_ENTRY_SIZE); - + bus_dmamap_sync(sc->sc_dmat, QLE_DMA_MAP(sc->sc_responses), id * QLE_QUEUE_ENTRY_SIZE, QLE_QUEUE_ENTRY_SIZE, BUS_DMASYNC_POSTREAD); @@ -1136,7 +1136,7 @@ qle_handle_resp(struct qle_softc *sc, u_int32_t id) sc->sc_marker_required = 1; xs->error = XS_DRIVER_STUFFUP; break; - + case QLE_IOCB_STATUS_TIMEOUT: DPRINTF(QLE_D_IO, "%s: command timed out\n", DEVNAME(sc)); @@ -1374,7 +1374,7 @@ qle_scsi_cmd(struct scsi_xfer *xs) iocb = QLE_DMA_KVA(sc->sc_requests) + offset; bus_dmamap_sync(sc->sc_dmat, QLE_DMA_MAP(sc->sc_requests), offset, QLE_QUEUE_ENTRY_SIZE, BUS_DMASYNC_POSTWRITE); - + ccb->ccb_xs = xs; qle_put_cmd(sc, iocb, xs, ccb, portid); @@ -1842,7 +1842,7 @@ qle_ct_pass_through(struct qle_softc *sc, u_int32_t port_handle, u_int16_t req; u_int64_t offset; int rv; - + mtx_enter(&sc->sc_queue_mtx); req = sc->sc_next_req_id++; @@ -1853,7 +1853,7 @@ qle_ct_pass_through(struct qle_softc *sc, u_int32_t port_handle, iocb = QLE_DMA_KVA(sc->sc_requests) + offset; bus_dmamap_sync(sc->sc_dmat, QLE_DMA_MAP(sc->sc_requests), offset, QLE_QUEUE_ENTRY_SIZE, BUS_DMASYNC_POSTWRITE); - + memset(iocb, 0, QLE_QUEUE_ENTRY_SIZE); iocb->entry_type = QLE_IOCB_CT_PASSTHROUGH; iocb->entry_count = 1; @@ -1983,7 +1983,7 @@ qle_fabric_plogx(struct qle_softc *sc, struct qle_fc_port *port, int flags, iocb = QLE_DMA_KVA(sc->sc_requests) + offset; bus_dmamap_sync(sc->sc_dmat, QLE_DMA_MAP(sc->sc_requests), offset, QLE_QUEUE_ENTRY_SIZE, BUS_DMASYNC_POSTWRITE); - + memset(iocb, 0, QLE_QUEUE_ENTRY_SIZE); iocb->entry_type = QLE_IOCB_PLOGX; iocb->entry_count = 1; @@ -2125,11 +2125,7 @@ qle_do_update(void *xsc) mtx_enter(&sc->sc_port_mtx); qle_clear_port_lists(sc); TAILQ_INIT(&detach); - while (!TAILQ_EMPTY(&sc->sc_ports)) { - port = TAILQ_FIRST(&sc->sc_ports); - TAILQ_REMOVE(&sc->sc_ports, port, ports); - TAILQ_INSERT_TAIL(&detach, port, ports); - } + TAILQ_CONCAT(&detach, &sc->sc_ports, ports); mtx_leave(&sc->sc_port_mtx); while (!TAILQ_EMPTY(&detach)) { @@ -2592,7 +2588,7 @@ qle_put_cmd(struct qle_softc *sc, void *buf, struct scsi_xfer *xs, req->req_handle = ccb->ccb_id; htolem16(&req->req_nport_handle, target); - + /* * timeout is in seconds. make sure it's at least 1 if a timeout * was specified in xs @@ -2659,7 +2655,7 @@ qle_put_cmd(struct qle_softc *sc, void *buf, struct scsi_xfer *xs, } if (xs->datalen > 0) cmnd->fcp_add_cdb_len |= (xs->flags & SCSI_DATA_IN) ? 2 : 1; - + bus_dmamap_sync(sc->sc_dmat, QLE_DMA_MAP(sc->sc_fcp_cmnds), fcp_cmnd_offset, sizeof(*cmnd), BUS_DMASYNC_PREWRITE); @@ -2785,7 +2781,7 @@ qle_read_nvram(struct qle_softc *sc) break; } base += sc->sc_port * 0x100; - + csum = 0; for (i = 0; i < nitems(data); i++) { data[i] = 0xffffffff; |