From nobody Sat Dec 18 11:49:25 2021 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 92D5318EFF51; Sat, 18 Dec 2021 11:49: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 4JGPK12Gwvz4s5R; Sat, 18 Dec 2021 11:49:25 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 2F03D6E0D; Sat, 18 Dec 2021 11:49: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 1BIBnPnU012716; Sat, 18 Dec 2021 11:49:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BIBnPhN012715; Sat, 18 Dec 2021 11:49:25 GMT (envelope-from git) Date: Sat, 18 Dec 2021 11:49:25 GMT Message-Id: <202112181149.1BIBnPhN012715@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 739a9c51b0b4 - main - geom(4): Fix some of the "set but not used" warnings 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: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 739a9c51b0b40bae675eb3fed504ae585d40b7e5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639828165; 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=Ex9uFLJz+wSBYpJdD/c7CD9Jvr+C0b1FijsT1RDa86U=; b=QgHI6vCvR4Bs/4PTtUq/F53GQkN3C9gDZ9qAHeJfa8W5C9m/Ef4zwGg1lWcSRYw/ZWb1yh 3+w+U0m1luG99OAcASyTiULb52coffU7YpE4HTxq69AgIMlyDf5pr4hAzCEOupNS4zGWKL yEu9NxlwAhanz2Dln/EP3CS8viF0SMTa+1SShxneaCK57Q1KTwXflVO9Jx7PaPdFtKv+Bo 40efe38G7uFRin1sxTid/X1meV/QSmFletP4mIacg6KsXRYfY2ZaNPMrBnovdowf3FAYmC RvKEeXvxR5oLbvRhTqETF0j/yzXdjQEMibNvM5la3mojVvhgqdb+qNuXD9afCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639828165; a=rsa-sha256; cv=none; b=K+31o0czvLA5ivZkp6nXSUgrq/smJMUP5M1xKofLvCI5A6u/K7GTeJpcUgyu7NYK4GLMQp QH+KU58mEv+b6ZuZVKhWhO4PZ3e/ni/GbCM302lFAA7T0hgrc3ITkTQrpkgoxrLL0ysKlf mAbySxRTWr4/G17TVrAZObqhVJqMw8tfQ9bga8pLTNMqEXxOEdlCuVBMo/kcKfuVAdic6q oOpFtAtY941SyBXqXIfPY/tGLiw/11JHPX8qhrf7FPyBtZwCq7108tS78+Wf5JQaTqGXWn nFRq1fPnZ4D1XOkXMzb9h7A6wDkYJ7NCTwXhAgBIGkqUmLhU+5h9v1GmOT7gDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=739a9c51b0b40bae675eb3fed504ae585d40b7e5 commit 739a9c51b0b40bae675eb3fed504ae585d40b7e5 Author: Edward Tomasz Napierala AuthorDate: 2021-12-13 15:19:56 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-12-18 11:42:34 +0000 geom(4): Fix some of the "set but not used" warnings The few I've left in place look like potential bugs. Sponsored By: EPSRC --- sys/geom/bde/g_bde.h | 13 +++++++++---- sys/geom/journal/g_journal.c | 2 +- sys/geom/shsec/g_shsec.c | 2 -- sys/geom/stripe/g_stripe.c | 2 +- sys/geom/vinum/geom_vinum_create.c | 3 +-- sys/geom/vinum/geom_vinum_init.c | 2 +- sys/geom/vinum/geom_vinum_plex.c | 2 -- sys/geom/vinum/geom_vinum_raid5.c | 3 --- sys/geom/vinum/geom_vinum_rename.c | 2 +- sys/geom/vinum/geom_vinum_subr.c | 2 +- sys/geom/vinum/geom_vinum_volume.c | 4 +--- sys/geom/virstor/g_virstor.c | 2 -- 12 files changed, 16 insertions(+), 23 deletions(-) diff --git a/sys/geom/bde/g_bde.h b/sys/geom/bde/g_bde.h index 3f36bb4281ae..2b9cc0532ef9 100644 --- a/sys/geom/bde/g_bde.h +++ b/sys/geom/bde/g_bde.h @@ -57,6 +57,11 @@ /* This just needs to be "large enough" */ #define G_BDE_KEYBYTES 304 +/* This file is being included by userspace. */ +#ifndef __diagused +#define __diagused +#endif + struct g_bde_work; struct g_bde_softc; @@ -176,7 +181,7 @@ void g_bde_worker(void *arg); static __inline void AES_init(cipherInstance *ci) { - int error; + int error __diagused; error = rijndael_cipherInit(ci, MODE_CBC, NULL); KASSERT(error > 0, ("rijndael_cipherInit %d", error)); @@ -185,7 +190,7 @@ AES_init(cipherInstance *ci) static __inline void AES_makekey(keyInstance *ki, int dir, u_int len, const void *key) { - int error; + int error __diagused; error = rijndael_makeKey(ki, dir, len, key); KASSERT(error > 0, ("rijndael_makeKey %d", error)); @@ -194,7 +199,7 @@ AES_makekey(keyInstance *ki, int dir, u_int len, const void *key) static __inline void AES_encrypt(cipherInstance *ci, keyInstance *ki, const void *in, void *out, u_int len) { - int error; + int error __diagused; error = rijndael_blockEncrypt(ci, ki, in, len * 8, out); KASSERT(error > 0, ("rijndael_blockEncrypt %d", error)); @@ -203,7 +208,7 @@ AES_encrypt(cipherInstance *ci, keyInstance *ki, const void *in, void *out, u_in static __inline void AES_decrypt(cipherInstance *ci, keyInstance *ki, const void *in, void *out, u_int len) { - int error; + int error __diagused; error = rijndael_blockDecrypt(ci, ki, in, len * 8, out); KASSERT(error > 0, ("rijndael_blockDecrypt %d", error)); diff --git a/sys/geom/journal/g_journal.c b/sys/geom/journal/g_journal.c index 954d0dbf2c6b..60c2aeb4fad6 100644 --- a/sys/geom/journal/g_journal.c +++ b/sys/geom/journal/g_journal.c @@ -2961,7 +2961,7 @@ next: static void g_journal_start_switcher(struct g_class *mp) { - int error; + int error __diagused; g_topology_assert(); MPASS(g_journal_switcher_proc == NULL); diff --git a/sys/geom/shsec/g_shsec.c b/sys/geom/shsec/g_shsec.c index a3b2f59d0555..65bfbc6681dd 100644 --- a/sys/geom/shsec/g_shsec.c +++ b/sys/geom/shsec/g_shsec.c @@ -249,11 +249,9 @@ g_shsec_xor1(uint32_t *src, uint32_t *dst, ssize_t len) static void g_shsec_done(struct bio *bp) { - struct g_shsec_softc *sc; struct bio *pbp; pbp = bp->bio_parent; - sc = pbp->bio_to->geom->softc; if (bp->bio_error == 0) G_SHSEC_LOGREQ(2, bp, "Request done."); else { diff --git a/sys/geom/stripe/g_stripe.c b/sys/geom/stripe/g_stripe.c index 9b4df1b8dba6..ec3bfb28b6a5 100644 --- a/sys/geom/stripe/g_stripe.c +++ b/sys/geom/stripe/g_stripe.c @@ -203,7 +203,7 @@ static int g_stripe_access(struct g_provider *pp, int dr, int dw, int de) { struct g_consumer *cp1, *cp2, *tmp; - struct g_stripe_softc *sc; + struct g_stripe_softc *sc __diagused; struct g_geom *gp; int error; diff --git a/sys/geom/vinum/geom_vinum_create.c b/sys/geom/vinum/geom_vinum_create.c index 036ce82c45e8..c828fdd5ac33 100644 --- a/sys/geom/vinum/geom_vinum_create.c +++ b/sys/geom/vinum/geom_vinum_create.c @@ -552,11 +552,10 @@ gv_stripe(struct g_geom *gp, struct gctl_req *req) struct gv_plex *p; struct gv_softc *sc; char *drive, buf[30], *vol; - int *drives, *flags, dcount, pcount; + int *drives, *flags, dcount; sc = gp->softc; dcount = 0; - pcount = 0; vol = gctl_get_param(req, "name", NULL); if (vol == NULL) { gctl_error(req, "volume name not given"); diff --git a/sys/geom/vinum/geom_vinum_init.c b/sys/geom/vinum/geom_vinum_init.c index 115a3c66d445..55899b480e63 100644 --- a/sys/geom/vinum/geom_vinum_init.c +++ b/sys/geom/vinum/geom_vinum_init.c @@ -233,7 +233,7 @@ gv_find_good_plex(struct gv_volume *v) static int gv_sync(struct gv_volume *v) { - struct gv_softc *sc; + struct gv_softc *sc __diagused; struct gv_plex *p, *up; int error; diff --git a/sys/geom/vinum/geom_vinum_plex.c b/sys/geom/vinum/geom_vinum_plex.c index a7b1e1e5a8bd..84203fcad6c9 100644 --- a/sys/geom/vinum/geom_vinum_plex.c +++ b/sys/geom/vinum/geom_vinum_plex.c @@ -538,10 +538,8 @@ gv_normal_parity(struct gv_plex *p, struct bio *bp, struct gv_raid5_packet *wp) static void gv_plex_flush(struct gv_plex *p) { - struct gv_softc *sc; struct bio *bp; - sc = p->vinumconf; bp = bioq_takefirst(p->rqueue); while (bp != NULL) { gv_plex_start(p, bp); diff --git a/sys/geom/vinum/geom_vinum_raid5.c b/sys/geom/vinum/geom_vinum_raid5.c index 2778646467e2..43a6a8bce330 100644 --- a/sys/geom/vinum/geom_vinum_raid5.c +++ b/sys/geom/vinum/geom_vinum_raid5.c @@ -345,15 +345,12 @@ static int gv_raid5_request(struct gv_plex *p, struct gv_raid5_packet *wp, struct bio *bp, caddr_t addr, off_t boff, off_t bcount, int *delay) { - struct g_geom *gp; struct gv_sd *broken, *original, *parity, *s; struct gv_bioq *bq; struct bio *cbp; int i, psdno, sdno, type, grow; off_t real_len, real_off; - gp = bp->bio_to->geom; - if (p == NULL || LIST_EMPTY(&p->subdisks)) return (ENXIO); diff --git a/sys/geom/vinum/geom_vinum_rename.c b/sys/geom/vinum/geom_vinum_rename.c index 688673268ef9..394f5afd0703 100644 --- a/sys/geom/vinum/geom_vinum_rename.c +++ b/sys/geom/vinum/geom_vinum_rename.c @@ -226,7 +226,7 @@ int gv_rename_vol(struct gv_softc *sc, struct gv_volume *v, char *newname, int flags) { - struct g_provider *pp; + struct g_provider *pp __diagused; struct gv_plex *p; char newplex[GV_MAXPLEXNAME], *ptr; int err; diff --git a/sys/geom/vinum/geom_vinum_subr.c b/sys/geom/vinum/geom_vinum_subr.c index 13edf928b6ad..54dd6db95e5e 100644 --- a/sys/geom/vinum/geom_vinum_subr.c +++ b/sys/geom/vinum/geom_vinum_subr.c @@ -1124,7 +1124,7 @@ int gv_attach_plex(struct gv_plex *p, struct gv_volume *v, int rename) { struct gv_sd *s; - struct gv_softc *sc; + struct gv_softc *sc __diagused; g_topology_assert(); diff --git a/sys/geom/vinum/geom_vinum_volume.c b/sys/geom/vinum/geom_vinum_volume.c index 63b1077a26fa..fec61ee28611 100644 --- a/sys/geom/vinum/geom_vinum_volume.c +++ b/sys/geom/vinum/geom_vinum_volume.c @@ -59,12 +59,10 @@ gv_volume_flush(struct gv_volume *v) void gv_volume_start(struct gv_softc *sc, struct bio *bp) { - struct g_geom *gp; struct gv_volume *v; struct gv_plex *p, *lp; int numwrites; - gp = sc->geom; v = bp->bio_to->private; if (v == NULL || v->state != GV_VOL_UP) { g_io_deliver(bp, ENXIO); @@ -143,7 +141,7 @@ gv_volume_start(struct gv_softc *sc, struct bio *bp) void gv_bio_done(struct gv_softc *sc, struct bio *bp) { - struct gv_volume *v; + struct gv_volume *v __diagused; struct gv_plex *p; struct gv_sd *s; diff --git a/sys/geom/virstor/g_virstor.c b/sys/geom/virstor/g_virstor.c index e27d92b509d4..6c201b24ab19 100644 --- a/sys/geom/virstor/g_virstor.c +++ b/sys/geom/virstor/g_virstor.c @@ -1528,11 +1528,9 @@ g_virstor_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, static void g_virstor_done(struct bio *b) { - struct g_virstor_softc *sc; struct bio *parent_b; parent_b = b->bio_parent; - sc = parent_b->bio_to->geom->softc; if (b->bio_error != 0) { LOG_MSG(LVL_ERROR, "Error %d for offset=%ju, length=%ju, %s",