git: 5a052b6114ea - main - Fix "set but not used" in opencrypto

From: Scott Long <scottl_at_FreeBSD.org>
Date: Sun, 05 Dec 2021 22:26:28 UTC
The branch main has been updated by scottl:

URL: https://cgit.FreeBSD.org/src/commit/?id=5a052b6114eae84a52519f75a4d504f544f86f98

commit 5a052b6114eae84a52519f75a4d504f544f86f98
Author:     Scott Long <scottl@FreeBSD.org>
AuthorDate: 2021-12-05 22:23:47 +0000
Commit:     Scott Long <scottl@FreeBSD.org>
CommitDate: 2021-12-05 22:25:44 +0000

    Fix "set but not used" in opencrypto
    
    Sponsored by: Rubicon Communications, LLC ("Netgate")
---
 sys/opencrypto/criov.c                   | 2 --
 sys/opencrypto/cryptosoft.c              | 4 ----
 sys/opencrypto/xform_chacha20_poly1305.c | 4 ++--
 3 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/sys/opencrypto/criov.c b/sys/opencrypto/criov.c
index 52f3d7988230..fe15a59676ae 100644
--- a/sys/opencrypto/criov.c
+++ b/sys/opencrypto/criov.c
@@ -158,7 +158,6 @@ static int
 cvm_page_apply(vm_page_t *pages, int off, int len,
     int (*f)(void *, const void *, u_int), void *arg)
 {
-	int processed = 0;
 	unsigned count;
 	int rval;
 
@@ -170,7 +169,6 @@ cvm_page_apply(vm_page_t *pages, int off, int len,
 		if (rval)
 			return (rval);
 		len -= count;
-		processed += count;
 		off = 0;
 		pages++;
 	}
diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c
index 94ba1a5af8f5..f8dfef5323d5 100644
--- a/sys/opencrypto/cryptosoft.c
+++ b/sys/opencrypto/cryptosoft.c
@@ -1550,8 +1550,6 @@ swcr_newsession(device_t dev, crypto_session_t cses,
     const struct crypto_session_params *csp)
 {
 	struct swcr_session *ses;
-	struct swcr_encdec *swe;
-	struct swcr_auth *swa;
 	const struct comp_algo *cxf;
 	int error;
 
@@ -1559,8 +1557,6 @@ swcr_newsession(device_t dev, crypto_session_t cses,
 	mtx_init(&ses->swcr_lock, "swcr session lock", NULL, MTX_DEF);
 
 	error = 0;
-	swe = &ses->swcr_encdec;
-	swa = &ses->swcr_auth;
 	switch (csp->csp_mode) {
 	case CSP_MODE_COMPRESS:
 		switch (csp->csp_cipher_alg) {
diff --git a/sys/opencrypto/xform_chacha20_poly1305.c b/sys/opencrypto/xform_chacha20_poly1305.c
index a88a04b28dad..d2ddf6a410c9 100644
--- a/sys/opencrypto/xform_chacha20_poly1305.c
+++ b/sys/opencrypto/xform_chacha20_poly1305.c
@@ -68,7 +68,7 @@ static void
 chacha20_poly1305_crypt(void *vctx, const uint8_t *in, uint8_t *out)
 {
 	struct chacha20_poly1305_cipher_ctx *ctx = vctx;
-	int error;
+	int error __diagused;
 
 	if (ctx->ietf)
 		error = crypto_stream_chacha20_ietf_xor_ic(out, in,
@@ -86,7 +86,7 @@ chacha20_poly1305_crypt_last(void *vctx, const uint8_t *in, uint8_t *out,
 {
 	struct chacha20_poly1305_cipher_ctx *ctx = vctx;
 
-	int error;
+	int error __diagused;
 
 	if (ctx->ietf)
 		error = crypto_stream_chacha20_ietf_xor_ic(out, in, len,