Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/opencrypto crypto(4): Fix set-but-unused variable warning.



details:   https://anonhg.NetBSD.org/src/rev/9465c5d4fe8a
branches:  trunk
changeset: 366289:9465c5d4fe8a
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat May 21 23:11:03 2022 +0000

description:
crypto(4): Fix set-but-unused variable warning.

This deliberately ignores the error code returned by crypto_dispatch,
but that error code is fundamentally incoherent and the issue will be
mooted by subsequent changes to make it return void and always pass
the error through the callback, as well as subsequent changes to rip
out the EAGAIN logic anyway.

diffstat:

 sys/opencrypto/cryptodev.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 0263bc247477 -r 9465c5d4fe8a sys/opencrypto/cryptodev.c
--- a/sys/opencrypto/cryptodev.c        Sat May 21 20:38:34 2022 +0000
+++ b/sys/opencrypto/cryptodev.c        Sat May 21 23:11:03 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cryptodev.c,v 1.114 2022/05/21 20:37:18 riastradh Exp $ */
+/*     $NetBSD: cryptodev.c,v 1.115 2022/05/21 23:11:03 riastradh Exp $ */
 /*     $FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $        */
 /*     $OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $   */
 
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.114 2022/05/21 20:37:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.115 2022/05/21 23:11:03 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -737,13 +737,12 @@
 cryptodev_mcb(struct cryptop *crp)
 {
        struct csession *cse = crp->crp_opaque;
-       int error = 0;
 
        mutex_enter(&cryptodev_mtx);
        cse->error = crp->crp_etype;
        if (crp->crp_etype == EAGAIN) {
                mutex_exit(&cryptodev_mtx);
-               error = crypto_dispatch(crp);
+               (void)crypto_dispatch(crp);
                mutex_enter(&cryptodev_mtx);
        }
 



Home | Main Index | Thread Index | Old Index