Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci ubsec(4): Nix dead code.



details:   https://anonhg.NetBSD.org/src/rev/f1011b1df598
branches:  trunk
changeset: 366200:f1011b1df598
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed May 18 12:48:49 2022 +0000

description:
ubsec(4): Nix dead code.

No functional change intended.

diffstat:

 sys/dev/pci/ubsec.c |  20 ++++----------------
 1 files changed, 4 insertions(+), 16 deletions(-)

diffs (57 lines):

diff -r c222fd025192 -r f1011b1df598 sys/dev/pci/ubsec.c
--- a/sys/dev/pci/ubsec.c       Wed May 18 00:37:11 2022 +0000
+++ b/sys/dev/pci/ubsec.c       Wed May 18 12:48:49 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ubsec.c,v 1.52 2020/06/14 23:22:09 riastradh Exp $     */
+/*     $NetBSD: ubsec.c,v 1.53 2022/05/18 12:48:49 riastradh Exp $     */
 /* $FreeBSD: src/sys/dev/ubsec/ubsec.c,v 1.6.2.6 2003/01/23 21:06:43 sam Exp $ */
 /*     $OpenBSD: ubsec.c,v 1.143 2009/03/27 13:31:30 reyk Exp$ */
 
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ubsec.c,v 1.52 2020/06/14 23:22:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ubsec.c,v 1.53 2022/05/18 12:48:49 riastradh Exp $");
 
 #undef UBSEC_DEBUG
 
@@ -1148,7 +1148,7 @@
 {
        struct ubsec_q *q = NULL;
        int err = 0, i, j, nicealign;
-       struct ubsec_softc *sc;
+       struct ubsec_softc *sc = arg;
        struct cryptodesc *crd1, *crd2, *maccrd, *enccrd;
        int encoffset = 0, macoffset = 0, cpskip, cpoffset;
        int sskip, dskip, stheend, dtheend;
@@ -1158,13 +1158,6 @@
        u_int16_t flags = 0;
        int ivlen = 0, keylen = 0;
 
-       sc = arg;
-       KASSERT(sc != NULL /*, ("ubsec_process: null softc")*/);
-
-       if (crp == NULL || crp->crp_callback == NULL || sc == NULL) {
-               ubsecstats.hst_invalid++;
-               return (EINVAL);
-       }
        if (UBSEC_SESSION(crp->crp_sid) >= sc->sc_nsessions) {
                ubsecstats.hst_badsession++;
                return (EINVAL);
@@ -2402,14 +2395,9 @@
 static int
 ubsec_kprocess(void *arg, struct cryptkop *krp, int hint)
 {
-       struct ubsec_softc *sc;
+       struct ubsec_softc *sc = arg;
        int r;
 
-       if (krp == NULL || krp->krp_callback == NULL)
-               return (EINVAL);
-       sc = arg;
-       KASSERT(sc != NULL /*, ("ubsec_kprocess: null softc")*/);
-
        while (!SIMPLEQ_EMPTY(&sc->sc_q2free)) {
                struct ubsec_q2 *q;
 



Home | Main Index | Thread Index | Old Index