From 8475a4175f5bef6811c9c2c7eafeaa941c0d20a0 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Thu, 15 Mar 2018 16:17:02 +0000 Subject: [PATCH] aesni(4): Stylistic/comment enhancements Improve clarity of a comment and style(9) some areas. No functional change. Reported by: markj (on review of a mostly-copied driver) Sponsored by: Dell EMC Isilon --- sys/crypto/aesni/aesni.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/crypto/aesni/aesni.c b/sys/crypto/aesni/aesni.c index a077fe51c3d9..6a12eda38020 100644 --- a/sys/crypto/aesni/aesni.c +++ b/sys/crypto/aesni/aesni.c @@ -327,8 +327,8 @@ unhandled: return (EINVAL); } /* - * Free sessions goes first, so if first session is used, we need to - * allocate one. + * Free sessions are inserted at the head of the list. So if the first + * session is used, none are free and we must allocate a new one. */ ses = TAILQ_FIRST(&sc->sessions); if (ses == NULL || ses->used) { @@ -403,11 +403,13 @@ aesni_freesession(device_t dev, uint64_t tid) static int aesni_process(device_t dev, struct cryptop *crp, int hint __unused) { - struct aesni_softc *sc = device_get_softc(dev); - struct aesni_session *ses = NULL; + struct aesni_softc *sc; + struct aesni_session *ses; struct cryptodesc *crd, *enccrd, *authcrd; int error, needauth; + sc = device_get_softc(dev); + ses = NULL; error = 0; enccrd = NULL; authcrd = NULL; @@ -538,7 +540,7 @@ static device_method_t aesni_methods[] = { DEVMETHOD(cryptodev_freesession, aesni_freesession), DEVMETHOD(cryptodev_process, aesni_process), - {0, 0}, + DEVMETHOD_END }; static driver_t aesni_driver = {