summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorGordon Willem Klok <gwk@cvs.openbsd.org>2006-05-27 04:08:58 +0000
committerGordon Willem Klok <gwk@cvs.openbsd.org>2006-05-27 04:08:58 +0000
commitc40422dc16d579f595b132adf02f91ebe4dc58cb (patch)
tree8baa7a97159d542af5bf986aa1d9fa4cabe34954 /sys/arch/i386
parent13b8513be63c3453f53f9d5939b5dd36232480c8 (diff)
casting mallloc
ok uwe@, dlg2
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/i686_mem.c7
-rw-r--r--sys/arch/i386/i386/mem.c5
-rw-r--r--sys/arch/i386/i386/via.c12
3 files changed, 11 insertions, 13 deletions
diff --git a/sys/arch/i386/i386/i686_mem.c b/sys/arch/i386/i386/i686_mem.c
index 3123f63e3ad..2effc56a0b7 100644
--- a/sys/arch/i386/i386/i686_mem.c
+++ b/sys/arch/i386/i386/i686_mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i686_mem.c,v 1.7 2006/05/11 13:21:11 mickey Exp $ */
+/* $OpenBSD: i686_mem.c,v 1.8 2006/05/27 04:08:57 gwk Exp $ */
/*-
* Copyright (c) 1999 Michael Smith <msmith@freebsd.org>
* All rights reserved.
@@ -569,9 +569,8 @@ i686_mrinit(sc)
nmdesc += MTRR_N64K + MTRR_N16K + MTRR_N4K;
}
- sc->mr_desc =
- (struct mem_range_desc *)malloc(nmdesc * sizeof(struct mem_range_desc),
- M_MEMDESC, M_WAITOK);
+ sc->mr_desc = malloc(nmdesc * sizeof(struct mem_range_desc),
+ M_MEMDESC, M_WAITOK);
bzero(sc->mr_desc, nmdesc * sizeof(struct mem_range_desc));
sc->mr_ndesc = nmdesc;
diff --git a/sys/arch/i386/i386/mem.c b/sys/arch/i386/i386/mem.c
index 99ade716983..44f7a4e784a 100644
--- a/sys/arch/i386/i386/mem.c
+++ b/sys/arch/i386/i386/mem.c
@@ -1,5 +1,5 @@
/* $NetBSD: mem.c,v 1.31 1996/05/03 19:42:19 christos Exp $ */
-/* $OpenBSD: mem.c,v 1.29 2006/05/11 13:21:11 mickey Exp $ */
+/* $OpenBSD: mem.c,v 1.30 2006/05/27 04:08:57 gwk Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
@@ -327,8 +327,7 @@ mem_ioctl(dev, cmd, data, flags, p)
break;
case MEMRANGE_SET:
- md = (struct mem_range_desc *)malloc(sizeof(struct mem_range_desc),
- M_MEMDESC, M_WAITOK);
+ md = malloc(sizeof(struct mem_range_desc), M_MEMDESC, M_WAITOK);
error = copyin(mo->mo_desc, md, sizeof(struct mem_range_desc));
/* clamp description string */
md->mr_owner[sizeof(md->mr_owner) - 1] = 0;
diff --git a/sys/arch/i386/i386/via.c b/sys/arch/i386/i386/via.c
index d5af608b55d..353dfba7792 100644
--- a/sys/arch/i386/i386/via.c
+++ b/sys/arch/i386/i386/via.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: via.c,v 1.4 2006/05/11 13:21:12 mickey Exp $ */
+/* $OpenBSD: via.c,v 1.5 2006/05/27 04:08:57 gwk Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -141,8 +141,8 @@ viac3_crypto_newsession(u_int32_t *sidp, struct cryptoini *cri)
C3_CRYPT_CWLO_NORMAL;
if (sc->sc_sessions == NULL) {
- ses = sc->sc_sessions = (struct viac3_session *)malloc(
- sizeof(*ses), M_DEVBUF, M_NOWAIT);
+ ses = sc->sc_sessions = malloc(sizeof(*ses), M_DEVBUF,
+ M_NOWAIT);
if (ses == NULL)
return (ENOMEM);
sesn = 0;
@@ -157,8 +157,8 @@ viac3_crypto_newsession(u_int32_t *sidp, struct cryptoini *cri)
if (ses == NULL) {
sesn = sc->sc_nsessions;
- ses = (struct viac3_session *)malloc((sesn + 1) *
- sizeof(*ses), M_DEVBUF, M_NOWAIT);
+ ses = malloc((sesn + 1) * sizeof(*ses), M_DEVBUF,
+ M_NOWAIT);
if (ses == NULL)
return (ENOMEM);
bcopy(sc->sc_sessions, ses, sesn * sizeof(*ses));
@@ -251,7 +251,7 @@ viac3_crypto_process(struct cryptop *crp)
}
ses = &sc->sc_sessions[sesn];
- sc->op_buf = (char *)malloc(crd->crd_len, M_DEVBUF, M_NOWAIT);
+ sc->op_buf = malloc(crd->crd_len, M_DEVBUF, M_NOWAIT);
if (sc->op_buf == NULL) {
err = ENOMEM;
goto out;