Date: Tue, 5 Dec 2006 04:57:21 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 111110 for review Message-ID: <200612050457.kB54vLIa060199@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=111110 Change 111110 by sam@sam_ebb on 2006/12/05 04:56:39 whitespace changes to reduce diffs against uncommitted work Affected files ... .. //depot/projects/crypto/sys/opencrypto/crypto.c#6 edit Differences ... ==== //depot/projects/crypto/sys/opencrypto/crypto.c#6 (text+ko) ==== @@ -720,7 +720,6 @@ int i, err; CRYPTO_DRIVER_LOCK(); - cap = crypto_checkdriver(driverid); if (cap != NULL && (CRYPTO_ALGORITHM_MIN <= alg && alg <= CRYPTO_ALGORITHM_MAX) && @@ -738,8 +737,8 @@ err = 0; } else err = EINVAL; + CRYPTO_DRIVER_UNLOCK(); - CRYPTO_DRIVER_UNLOCK(); return err; } @@ -757,15 +756,14 @@ int err; CRYPTO_DRIVER_LOCK(); - cap = crypto_checkdriver(driverid); if (cap != NULL) { driver_finis(cap); err = 0; } else err = EINVAL; + CRYPTO_DRIVER_UNLOCK(); - CRYPTO_DRIVER_UNLOCK(); return err; } @@ -849,20 +847,20 @@ int crypto_kdispatch(struct cryptkop *krp) { - int result; + int error; cryptostats.cs_kops++; - result = crypto_kinvoke(krp, krp->krp_crid); - if (result != ERESTART) - return (result); - CRYPTO_Q_LOCK(); - TAILQ_INSERT_TAIL(&crp_kq, krp, krp_next); - if (crp_sleep) - wakeup_one(&crp_q); - CRYPTO_Q_UNLOCK(); - - return 0; + error = crypto_kinvoke(krp, krp->krp_crid); + if (error == ERESTART) { + CRYPTO_Q_LOCK(); + TAILQ_INSERT_TAIL(&crp_kq, krp, krp_next); + if (crp_sleep) + wakeup_one(&crp_q); + CRYPTO_Q_UNLOCK(); + error = 0; + } + return error; } /* @@ -1222,13 +1220,14 @@ CRYPTO_DRIVER_LOCK(); for (hid = 0; hid < crypto_drivers_num; hid++) { - if ((crypto_drivers[hid].cc_flags & CRYPTOCAP_F_SOFTWARE) && + const struct cryptocap *cap = &crypto_drivers[hid]; + + if ((cap->cc_flags & CRYPTOCAP_F_SOFTWARE) && !crypto_devallowsoft) { continue; } for (kalg = 0; kalg < CRK_ALGORITHM_MAX; kalg++) - if ((crypto_drivers[hid].cc_kalg[kalg] & - CRYPTO_ALG_FLAG_SUPPORTED) != 0) + if (cap->cc_kalg[kalg] & CRYPTO_ALG_FLAG_SUPPORTED) feat |= 1 << kalg; } CRYPTO_DRIVER_UNLOCK();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612050457.kB54vLIa060199>