From afa372e686eb8138537c13a18e6fd0abdc8e7d70 Mon Sep 17 00:00:00 2001 From: Gilles Chehade Date: Tue, 9 Oct 2007 17:06:19 +0000 Subject: MALLOC -> malloc ok krw@ --- sys/dev/bio.c | 4 ++-- sys/dev/ic/if_wi_hostap.c | 11 +++++------ sys/dev/isa/aha.c | 6 +++--- sys/dev/onewire/onewire.c | 8 ++++---- sys/dev/pci/maestro.c | 6 +++--- sys/dev/rnd.c | 10 +++++----- 6 files changed, 22 insertions(+), 23 deletions(-) (limited to 'sys') diff --git a/sys/dev/bio.c b/sys/dev/bio.c index fb7d6cbf87a..ad28ba5fe10 100644 --- a/sys/dev/bio.c +++ b/sys/dev/bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio.c,v 1.9 2007/03/20 02:35:55 marco Exp $ */ +/* $OpenBSD: bio.c,v 1.10 2007/10/09 17:05:19 gilles Exp $ */ /* * Copyright (c) 2002 Niklas Hallqvist. All rights reserved. @@ -103,7 +103,7 @@ bio_register(struct device *dev, int (*ioctl)(struct device *, u_long, caddr_t)) { struct bio_mapping *bm; - MALLOC(bm, struct bio_mapping *, sizeof *bm, M_DEVBUF, M_NOWAIT); + bm = malloc(sizeof *bm, M_DEVBUF, M_NOWAIT); if (bm == NULL) return (ENOMEM); bm->bm_dev = dev; diff --git a/sys/dev/ic/if_wi_hostap.c b/sys/dev/ic/if_wi_hostap.c index d0be03501ed..6a54188a3b6 100644 --- a/sys/dev/ic/if_wi_hostap.c +++ b/sys/dev/ic/if_wi_hostap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi_hostap.c,v 1.39 2007/10/06 02:18:38 krw Exp $ */ +/* $OpenBSD: if_wi_hostap.c,v 1.40 2007/10/09 17:06:18 gilles Exp $ */ /* * Copyright (c) 2002 @@ -297,7 +297,7 @@ wihap_shutdown(struct wi_softc *sc) printf("wihap_shutdown: free(sta=%p)\n", sta); next = TAILQ_NEXT(sta, list); if (sta->challenge) - FREE(sta->challenge, M_TEMP); + free(sta->challenge, M_TEMP); free(sta, M_DEVBUF); } TAILQ_INIT(&whi->sta_list); @@ -443,7 +443,7 @@ wihap_sta_delete(struct wihap_sta_info *sta) TAILQ_REMOVE(&whi->sta_list, sta, list); LIST_REMOVE(sta, hash); if (sta->challenge) - FREE(sta->challenge, M_TEMP); + free(sta->challenge, M_TEMP); free(sta, M_DEVBUF); whi->n_stations--; } @@ -643,8 +643,7 @@ wihap_auth_req(struct wi_softc *sc, struct wi_frame *rxfrm, case 1: /* Create a challenge frame. */ if (!sta->challenge) { - MALLOC(sta->challenge, u_int32_t *, 128, - M_TEMP, M_NOWAIT); + sta->challenge = malloc(128, M_TEMP, M_NOWAIT); if (!sta->challenge) return; } @@ -671,7 +670,7 @@ wihap_auth_req(struct wi_softc *sc, struct wi_frame *rxfrm, } sta->flags |= WI_SIFLAGS_AUTHEN; - FREE(sta->challenge, M_TEMP); + free(sta->challenge, M_TEMP); sta->challenge = NULL; challenge_len = 0; break; diff --git a/sys/dev/isa/aha.c b/sys/dev/isa/aha.c index dcfa5cd344a..06ae3f935bf 100644 --- a/sys/dev/isa/aha.c +++ b/sys/dev/isa/aha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aha.c,v 1.57 2007/08/15 02:04:30 krw Exp $ */ +/* $OpenBSD: aha.c,v 1.58 2007/10/09 17:06:18 gilles Exp $ */ /* $NetBSD: aha.c,v 1.11 1996/05/12 23:51:23 mycroft Exp $ */ #undef AHADIAG @@ -669,7 +669,7 @@ aha_get_ccb(sc, flags) break; } if (sc->sc_numccbs < AHA_CCB_MAX) { - MALLOC(ccb, struct aha_ccb *, sizeof *ccb, M_DEVBUF, + ccb = malloc(sizeof *ccb, M_DEVBUF, (flags & SCSI_NOSLEEP) ? M_NOWAIT : M_WAITOK); if (ccb == NULL) { printf("%s: can't malloc ccb\n", @@ -680,7 +680,7 @@ aha_get_ccb(sc, flags) sc->sc_numccbs++; break; } - FREE(ccb, M_DEVBUF); + free(ccb, M_DEVBUF); ccb = NULL; } if (flags & SCSI_NOSLEEP) diff --git a/sys/dev/onewire/onewire.c b/sys/dev/onewire/onewire.c index 8a417e36332..e8ac801661a 100644 --- a/sys/dev/onewire/onewire.c +++ b/sys/dev/onewire/onewire.c @@ -1,4 +1,4 @@ -/* $OpenBSD: onewire.c,v 1.7 2006/10/08 21:12:51 grange Exp $ */ +/* $OpenBSD: onewire.c,v 1.8 2007/10/09 17:06:18 gilles Exp $ */ /* * Copyright (c) 2006 Alexander Yurchenko @@ -469,8 +469,8 @@ onewire_scan(struct onewire_softc *sc) onewire_print)) == NULL) continue; - MALLOC(nd, struct onewire_device *, - sizeof(struct onewire_device), M_DEVBUF, M_NOWAIT); + nd = malloc(sizeof(struct onewire_device), + M_DEVBUF, M_NOWAIT); if (nd == NULL) continue; nd->d_dev = dev; @@ -488,7 +488,7 @@ out: if (!d->d_present) { config_detach(d->d_dev, DETACH_FORCE); TAILQ_REMOVE(&sc->sc_devs, d, d_list); - FREE(d, M_DEVBUF); + free(d, M_DEVBUF); } } } diff --git a/sys/dev/pci/maestro.c b/sys/dev/pci/maestro.c index d8e1863a137..e7238de1900 100644 --- a/sys/dev/pci/maestro.c +++ b/sys/dev/pci/maestro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: maestro.c,v 1.21 2006/12/29 13:04:37 pedro Exp $ */ +/* $OpenBSD: maestro.c,v 1.22 2007/10/09 17:06:18 gilles Exp $ */ /* $FreeBSD: /c/ncvs/src/sys/dev/sound/pci/maestro.c,v 1.3 2000/11/21 12:22:11 julian Exp $ */ /* * FreeBSD's ESS Agogo/Maestro driver @@ -1824,7 +1824,7 @@ salloc_new(addr, size, nzones) struct salloc_zone *space; int i; - MALLOC(pool, salloc_t, sizeof *pool + nzones * sizeof pool->zones[0], + pool = malloc(sizeof *pool + nzones * sizeof pool->zones[0], M_TEMP, M_NOWAIT); if (pool == NULL) return NULL; @@ -1846,7 +1846,7 @@ void salloc_destroy(pool) salloc_t pool; { - FREE(pool, M_TEMP); + free(pool, M_TEMP); } void diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c index 703c58736d4..badb616ff78 100644 --- a/sys/dev/rnd.c +++ b/sys/dev/rnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rnd.c,v 1.82 2007/06/17 21:22:04 jasper Exp $ */ +/* $OpenBSD: rnd.c,v 1.83 2007/10/09 17:05:19 gilles Exp $ */ /* * rnd.c -- A strong random number generator @@ -947,7 +947,7 @@ randomread(dev_t dev, struct uio *uio, int ioflag) if (uio->uio_resid == 0) return 0; - MALLOC(buf, u_int32_t *, POOLBYTES, M_TEMP, M_WAITOK); + buf = malloc(POOLBYTES, M_TEMP, M_WAITOK); while (!ret && uio->uio_resid > 0) { int n = min(POOLBYTES, uio->uio_resid); @@ -1013,7 +1013,7 @@ randomread(dev_t dev, struct uio *uio, int ioflag) ret = uiomove((caddr_t)buf, n, uio); } - FREE(buf, M_TEMP); + free(buf, M_TEMP); return ret; } @@ -1105,7 +1105,7 @@ randomwrite(dev_t dev, struct uio *uio, int flags) if (uio->uio_resid == 0) return 0; - MALLOC(buf, u_int32_t *, POOLBYTES, M_TEMP, M_WAITOK); + buf = malloc(POOLBYTES, M_TEMP, M_WAITOK); while (!ret && uio->uio_resid > 0) { u_short n = min(POOLBYTES, uio->uio_resid); @@ -1121,7 +1121,7 @@ randomwrite(dev_t dev, struct uio *uio, int flags) if (minor(dev) == RND_ARND && !ret) arc4random_initialized = 0; - FREE(buf, M_TEMP); + free(buf, M_TEMP); return ret; } -- cgit v1.2.3