summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorFrederic Cambus <fcambus@cvs.openbsd.org>2018-05-31 20:19:06 +0000
committerFrederic Cambus <fcambus@cvs.openbsd.org>2018-05-31 20:19:06 +0000
commite56f180c5018c2a7bd4b4f9bdf43d8eaecedf450 (patch)
treefdfebd712218934eebedc043f78751d89773cbb9 /sys/arch/amd64
parent11975d9791bb6948a0dff38484b21d56dcc0cfbd (diff)
Return error values directly where appropriate, instead of using the err
variable. While there, remove TODO about bitching. We haven't felt the need to bitch since the driver was commited, and we do not bitch in aesni_setup() either. OK visa@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/via.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/arch/amd64/amd64/via.c b/sys/arch/amd64/amd64/via.c
index 284649cf675..f141272c77b 100644
--- a/sys/arch/amd64/amd64/via.c
+++ b/sys/arch/amd64/amd64/via.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: via.c,v 1.29 2018/04/28 15:44:59 jasper Exp $ */
+/* $OpenBSD: via.c,v 1.30 2018/05/31 20:19:05 fcambus Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -87,7 +87,7 @@ viac3_crypto_setup(void)
vc3_sc = malloc(sizeof(*vc3_sc), M_DEVBUF, M_NOWAIT|M_ZERO);
if (vc3_sc == NULL)
- return; /* YYY bitch? */
+ return;
bzero(algs, sizeof(algs));
algs[CRYPTO_AES_CBC] = CRYPTO_ALG_FLAG_SUPPORTED;
@@ -102,7 +102,7 @@ viac3_crypto_setup(void)
vc3_sc->sc_cid = crypto_get_driverid(0);
if (vc3_sc->sc_cid < 0) {
free(vc3_sc, M_DEVBUF, sizeof(*vc3_sc));
- return; /* YYY bitch? */
+ return;
}
crypto_register(vc3_sc->sc_cid, algs, viac3_crypto_newsession,
@@ -340,16 +340,12 @@ viac3_crypto_encdec(struct cryptop *crp, struct cryptodesc *crd,
u_int32_t *key;
int err = 0;
- if ((crd->crd_len % 16) != 0) {
- err = EINVAL;
- return (err);
- }
+ if ((crd->crd_len % 16) != 0)
+ return (EINVAL);
sc->op_buf = malloc(crd->crd_len, M_DEVBUF, M_NOWAIT);
- if (sc->op_buf == NULL) {
- err = ENOMEM;
- return (err);
- }
+ if (sc->op_buf == NULL)
+ return (ENOMEM);
if (crd->crd_flags & CRD_F_ENCRYPT) {
sc->op_cw[0] = ses->ses_cw0 | C3_CRYPT_CWLO_ENCRYPT;