From nobody Sun Aug 14 16:07:25 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 4M5MkP59dQz4ZXNh; Sun, 14 Aug 2022 16:07:25 +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 4M5MkP4jfZz3m0c; Sun, 14 Aug 2022 16:07:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660493245; 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=6gsGuH82DKEnm55gYP8GeE5+p/G1HPnhwrxJBMC0wjY=; b=kXTeUryoDuhkW9FonTQGYnnsn7mAtvMuxHX8QXBMb/gWPykYgFjkMWAMHRBJgsmiKfCnSa FSMTdn/4b3MUQlDbrZJgdFrIywa/bBb3arKl09ezd716rzkyXQCoPWU+OItqjLzlg2VXDg 6ddtOblP2xcONeICWQkFWaKMvpPetCuIhjRjfayM+oc5EU7Ut86T6je1Rjl5qaxQTi3BsD ZQk69ULy13Saefvn3DBWyFZ3sXIhsbTL/cXGw0WW/yT4EoSbXrI2zjQCV8MtuD7boQBd/M h4rQhf9m/M/gXN8HBtDNnDM2LIFJakgqGgvC8z/tADPtKSCIyjBff3q2/TZXAQ== 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 4M5MkP3mbSzwb5; Sun, 14 Aug 2022 16:07:25 +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 27EG7PgX062506; Sun, 14 Aug 2022 16:07:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27EG7PoS062505; Sun, 14 Aug 2022 16:07:25 GMT (envelope-from git) Date: Sun, 14 Aug 2022 16:07:25 GMT Message-Id: <202208141607.27EG7PoS062505@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: af86d12c80f1 - main - 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/main X-Git-Reftype: branch X-Git-Commit: af86d12c80f10dcd4a57ff7834891890b255087d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660493245; 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=6gsGuH82DKEnm55gYP8GeE5+p/G1HPnhwrxJBMC0wjY=; b=cxUuZjTwb2OLoiEIOTNWCDwSpr2gkTlLI78zAi5yLZ8zNdyuaFF19E9NHAikkPAQN0foOa T4EB3C6+aqO5IU/T39SzlOOeG3ukj+vqP0H3eRZBRrDMdbj6TaxoRc4RG9lR3BBmvd9YYE 553uSQaciQVuk4VWncGsE+z1sY/LO5jCl85YFLxuFS3Wx0elVtiaFIMci3wYH8er7xwEpt BDTOG8tpjoGStB6b4dNpNMVbAGNUD95BHA1c/IHszt2cfsdt3bY4A3ClTvn4VXAhTTY0FE u6+Sn0QTwtPBbIqWvbb3+dSxgJ1XvEmh/U8PvPShrS7Fen5d+Z0g/pQo/4mmXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660493245; a=rsa-sha256; cv=none; b=G1KaQmbv5OMgm/uzqP18f64bUlmvt++e2GJU1VeTQYfbDlF+NWTnAZaYLArlhW564hsapt 5oTOl3Zo1/P2ZL/PTWwUn+canLyAn37P36yOeO+4+DCyxJnWZXjKwywFeeyKftablEoCK6 F89eFSQzQi6UAS28VQ1WuY++ulZevqPuvw4Q3HwaDSPmbkwOuHJvVdM9T4SVzst6u/HP4W P5oCtZUx1icp3SXJ6hH0cDLPq/mzQLVW6jTdk3Ma/CD5UdHikgFHjUPi63XmfakufMWIx7 An9QzMbmUzVELD2ssc6XpvdVK+DqXudsb0PiRrkjEe+W6Z8PoI4IF/fCW3BZjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=af86d12c80f10dcd4a57ff7834891890b255087d commit af86d12c80f10dcd4a57ff7834891890b255087d Author: Mark Johnston AuthorDate: 2022-08-14 15:56:33 +0000 Commit: Mark Johnston CommitDate: 2022-08-14 15:56:33 +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 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36118 --- 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 92d4ce286940..b832caa6f05d 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -1670,18 +1670,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) { @@ -1713,12 +1712,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); } @@ -1727,7 +1725,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) { @@ -1772,7 +1770,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) { @@ -1970,8 +1968,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); @@ -2263,8 +2261,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]; @@ -2272,11 +2269,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) { @@ -2351,7 +2344,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); @@ -2366,8 +2359,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) @@ -2584,8 +2577,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); } } @@ -2787,8 +2780,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); } @@ -2800,7 +2792,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", @@ -3026,8 +3018,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; @@ -3089,8 +3081,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; @@ -3217,7 +3209,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; @@ -3239,7 +3232,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;