svn commit: r331007 - head/sys/crypto/aesni
Conrad Meyer
cem at FreeBSD.org
Thu Mar 15 16:17:03 UTC 2018
Author: cem
Date: Thu Mar 15 16:17:02 2018
New Revision: 331007
URL: https://svnweb.freebsd.org/changeset/base/331007
Log:
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
Modified:
head/sys/crypto/aesni/aesni.c
Modified: head/sys/crypto/aesni/aesni.c
==============================================================================
--- head/sys/crypto/aesni/aesni.c Thu Mar 15 15:13:17 2018 (r331006)
+++ head/sys/crypto/aesni/aesni.c Thu Mar 15 16:17:02 2018 (r331007)
@@ -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 = {
More information about the svn-src-all
mailing list