From nobody Mon Aug 29 15:01:17 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MGYY92zSLz4bJX1; Mon, 29 Aug 2022 15:01:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MGYY92XT2z4M03; Mon, 29 Aug 2022 15:01:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661785277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FKiz1BHDNmF0A85OprvpWVw07aCVV3Ismzz6XmhCwec=; b=temuknRHg7tknQA90f5TVS8BSYv2JZ9/5gSa1EHBw9CBKYlKPlwo97zM0l81NWTl4/Gu0K zrM1CEulQQA2yhmwJr7mo0COQ55ZVUGD4AMW46vefuOBkEyvGQDNVEr7UmVhL6U3KXgzqp X4C/2vjyBLhTHLsqqdaaiQ/9mldrCHXi+f/iIZIgjSmAXqgO3Jxx3xRegZXTx128NmW5YN GeBlYgL6U9pktJxgwSDi14EszG1gOvNned7PAiGSc/09nu35Vdf+vs6VML7yaCk5jPVGlB TbwRJoJfr5E99oMb4GH4cr92TsHNjM7aICnHkFo6te/KpiGMTE3lz7xQHjyRfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MGYY91btMzSnf; Mon, 29 Aug 2022 15:01:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27TF1HWJ062367; Mon, 29 Aug 2022 15:01:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27TF1HCP062366; Mon, 29 Aug 2022 15:01:17 GMT (envelope-from git) Date: Mon, 29 Aug 2022 15:01:17 GMT Message-Id: <202208291501.27TF1HCP062366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e6b7a23d7faa - stable/13 - bhyve: Address -Wunused* warnings in pci_nvme.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e6b7a23d7faa95c613f3b5ca2bb34da4069fd051 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661785277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FKiz1BHDNmF0A85OprvpWVw07aCVV3Ismzz6XmhCwec=; b=Pa1iLllv8i4sQx53A6E3m2j/hhHTF7Z3Kkb6ei8UtQnNe3+ZjfSQ4B4kPJVqHo+sJZGC2h X2aSt2qaS36jAMV/QJS4rmenITwrvY322LOU7RW7jIqMQ2+GQhbF+5Hp9Oaov11xAgcKy+ i/lVwTsC62Z/XxqFPO4IEcJa6eW9RSlfVNXWK+Vu/wRaNYj8ch/s7bEfIZlZdf0845Gfd2 OnTWy9gdzb7AsjdbWideo/IIMxhJ7bKWTrMyZBuEGCBf2wWmkoJEn00lmJ2qhrxRuX5xBe ive0nJj1sGLeNEriYYWwVA2JcHGeLrU+BCSW1qYtLQF939YC7b9keaXONDoomg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661785277; a=rsa-sha256; cv=none; b=AYGIJ6hkVDCNyC3FCNg1UUGYybvhJrMsUcUUxHIC5DAKuUT5e/V4K6w94388smRDfe4EGJ 4zmpZJYCg7S7PiQbjDJPdlKmlkbTg72qjy/Lrsn54hOP2jerv+ALyNP9qmjx8ODbjPoGIH PyzFJJ5SZ9Cdsle1xe0ow7wIsuMMnAM8COh5M4vEmUM5/7RDR3Bkx9GjJ2teIYF3NFJBIm xpmIXZHGfO0IwHus+rWiFncSyPu5fqzbBpPNuvUFPlC+2mt/eYDjLNKEm3p5+kZsxeAj0B 3zhfEYztKx1Ah1BoQmecCnqUbc4EES6dtYHJIF4immOvGlgvzPm2d4XpqIwQZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e6b7a23d7faa95c613f3b5ca2bb34da4069fd051 commit e6b7a23d7faa95c613f3b5ca2bb34da4069fd051 Author: Mark Johnston AuthorDate: 2022-08-14 15:56:33 +0000 Commit: Mark Johnston CommitDate: 2022-08-29 15:00:51 +0000 bhyve: Address -Wunused* warnings in pci_nvme.c Currently these are not reported because bhyve is compiled with WARNS=2. Let's start taking small steps towards enabling more warnings. No functional change intended. Reviewed by: chuck, imp, emaste Sponsored by: The FreeBSD Foundation (cherry picked from commit af86d12c80f10dcd4a57ff7834891890b255087d) --- usr.sbin/bhyve/pci_nvme.c | 59 +++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 4bff296a20f3..6bed8ef8a731 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -1638,18 +1638,17 @@ nvme_fid_to_name(uint8_t fid) } static void -nvme_feature_invalid_cb(struct pci_nvme_softc *sc, - struct nvme_feature_obj *feat, - struct nvme_command *command, +nvme_feature_invalid_cb(struct pci_nvme_softc *sc __unused, + struct nvme_feature_obj *feat __unused, + struct nvme_command *command __unused, struct nvme_completion *compl) { - pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); } static void nvme_feature_iv_config(struct pci_nvme_softc *sc, - struct nvme_feature_obj *feat, + struct nvme_feature_obj *feat __unused, struct nvme_command *command, struct nvme_completion *compl) { @@ -1681,12 +1680,11 @@ nvme_feature_iv_config(struct pci_nvme_softc *sc, #define NVME_ASYNC_EVENT_ENDURANCE_GROUP (0x4000) static void -nvme_feature_async_event(struct pci_nvme_softc *sc, - struct nvme_feature_obj *feat, +nvme_feature_async_event(struct pci_nvme_softc *sc __unused, + struct nvme_feature_obj *feat __unused, struct nvme_command *command, struct nvme_completion *compl) { - if (command->cdw11 & NVME_ASYNC_EVENT_ENDURANCE_GROUP) pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); } @@ -1695,7 +1693,7 @@ nvme_feature_async_event(struct pci_nvme_softc *sc, #define NVME_TEMP_THRESH_UNDER 1 static void nvme_feature_temperature(struct pci_nvme_softc *sc, - struct nvme_feature_obj *feat, + struct nvme_feature_obj *feat __unused, struct nvme_command *command, struct nvme_completion *compl) { @@ -1740,7 +1738,7 @@ nvme_feature_temperature(struct pci_nvme_softc *sc, static void nvme_feature_num_queues(struct pci_nvme_softc *sc, - struct nvme_feature_obj *feat, + struct nvme_feature_obj *feat __unused, struct nvme_command *command, struct nvme_completion *compl) { @@ -1938,8 +1936,8 @@ nvme_opc_format_nvm(struct pci_nvme_softc* sc, struct nvme_command* command, } static int -nvme_opc_abort(struct pci_nvme_softc* sc, struct nvme_command* command, - struct nvme_completion* compl) +nvme_opc_abort(struct pci_nvme_softc *sc __unused, struct nvme_command *command, + struct nvme_completion *compl) { DPRINTF("%s submission queue %u, command ID 0x%x", __func__, command->cdw10 & 0xFFFF, (command->cdw10 >> 16) & 0xFFFF); @@ -2217,8 +2215,7 @@ pci_nvme_append_iov_req(struct pci_nvme_softc *sc, struct pci_nvme_ioreq *req, static void pci_nvme_set_completion(struct pci_nvme_softc *sc, - struct nvme_submission_queue *sq, int sqid, uint16_t cid, - uint32_t cdw0, uint16_t status) + struct nvme_submission_queue *sq, int sqid, uint16_t cid, uint16_t status) { struct nvme_completion_queue *cq = &sc->compl_queues[sq->cqid]; @@ -2226,11 +2223,7 @@ pci_nvme_set_completion(struct pci_nvme_softc *sc, __func__, sqid, sq->cqid, cid, NVME_STATUS_GET_SCT(status), NVME_STATUS_GET_SC(status)); - pci_nvme_cq_update(sc, cq, - 0, /* CDW0 */ - cid, - sqid, - status); + pci_nvme_cq_update(sc, cq, 0, cid, sqid, status); if (cq->head != cq->tail) { if (cq->intr_en & NVME_CQ_INTEN) { @@ -2305,7 +2298,7 @@ pci_nvme_io_done(struct blockif_req *br, int err) code = err ? NVME_SC_DATA_TRANSFER_ERROR : NVME_SC_SUCCESS; pci_nvme_status_genc(&status, code); - pci_nvme_set_completion(req->sc, sq, req->sqid, req->cid, 0, status); + pci_nvme_set_completion(req->sc, sq, req->sqid, req->cid, status); pci_nvme_stats_write_read_update(req->sc, req->opc, req->bytes, status); pci_nvme_release_ioreq(req->sc, req); @@ -2320,8 +2313,8 @@ pci_nvme_io_done(struct blockif_req *br, int err) * not supported (i.e. RAM or as indicated by the blockif). */ static bool -nvme_opc_flush(struct pci_nvme_softc *sc, - struct nvme_command *cmd, +nvme_opc_flush(struct pci_nvme_softc *sc __unused, + struct nvme_command *cmd __unused, struct pci_nvme_blockstore *nvstore, struct pci_nvme_ioreq *req, uint16_t *status) @@ -2537,8 +2530,8 @@ pci_nvme_dealloc_sm(struct blockif_req *br, int err) } if (done) { - pci_nvme_set_completion(sc, req->nvme_sq, req->sqid, - req->cid, 0, status); + pci_nvme_set_completion(sc, req->nvme_sq, req->sqid, req->cid, + status); pci_nvme_release_ioreq(sc, req); } } @@ -2740,8 +2733,7 @@ pci_nvme_handle_io_cmd(struct pci_nvme_softc* sc, uint16_t idx) } complete: if (!pending) { - pci_nvme_set_completion(sc, sq, idx, cmd->cid, 0, - status); + pci_nvme_set_completion(sc, sq, idx, cmd->cid, status); if (req != NULL) pci_nvme_release_ioreq(sc, req); } @@ -2753,7 +2745,7 @@ complete: } static void -pci_nvme_handle_doorbell(struct vmctx *ctx, struct pci_nvme_softc* sc, +pci_nvme_handle_doorbell(struct vmctx *ctx __unused, struct pci_nvme_softc* sc, uint64_t idx, int is_sq, uint64_t value) { DPRINTF("nvme doorbell %lu, %s, val 0x%lx", @@ -2966,8 +2958,8 @@ pci_nvme_write_bar_0(struct vmctx *ctx, struct pci_nvme_softc* sc, } static void -pci_nvme_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, - int baridx, uint64_t offset, int size, uint64_t value) +pci_nvme_write(struct vmctx *ctx, int vcpu __unused, struct pci_devinst *pi, + int baridx, uint64_t offset, int size, uint64_t value) { struct pci_nvme_softc* sc = pi->pi_arg; @@ -3029,8 +3021,8 @@ static uint64_t pci_nvme_read_bar_0(struct pci_nvme_softc* sc, static uint64_t -pci_nvme_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx, - uint64_t offset, int size) +pci_nvme_read(struct vmctx *ctx __unused, int vcpu __unused, + struct pci_devinst *pi, int baridx, uint64_t offset, int size) { struct pci_nvme_softc* sc = pi->pi_arg; @@ -3157,7 +3149,8 @@ pci_nvme_parse_config(struct pci_nvme_softc *sc, nvlist_t *nvl) } static void -pci_nvme_resized(struct blockif_ctxt *bctxt, void *arg, size_t new_size) +pci_nvme_resized(struct blockif_ctxt *bctxt __unused, void *arg, + size_t new_size) { struct pci_nvme_softc *sc; struct pci_nvme_blockstore *nvstore; @@ -3179,7 +3172,7 @@ pci_nvme_resized(struct blockif_ctxt *bctxt, void *arg, size_t new_size) } static int -pci_nvme_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) +pci_nvme_init(struct vmctx *ctx __unused, struct pci_devinst *pi, nvlist_t *nvl) { struct pci_nvme_softc *sc; uint32_t pci_membar_sz;