summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-05-19 18:42:14 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-05-19 18:42:14 +0000
commit5d2ff6359ca4a53dc1c448b39265f3ecd2ed8429 (patch)
tree68989f90b67654dca08e3b35f7ba9a6712417e8e
parentfa629703d5a7a82270cb5b8557a7eb07f52743af (diff)
Change all remaining MD uses of MALLOC and FREE into proper malloc() and
free() calls; prodded by chl@, ok krw@
-rw-r--r--sys/arch/arm/arm/undefined.c6
-rw-r--r--sys/arch/arm/xscale/pxa2x0_gpio.c6
-rw-r--r--sys/arch/arm/xscale/pxa2x0_intr.c6
-rw-r--r--sys/arch/hppa/hppa/intr.c10
-rw-r--r--sys/arch/mac68k/dev/nubus.c4
-rw-r--r--sys/arch/mac68k/mac68k/disksubr.c8
-rw-r--r--sys/arch/mvme68k/dev/ssh.c6
-rw-r--r--sys/arch/mvme68k/dev/vs.c4
-rw-r--r--sys/arch/zaurus/dev/zaurus_flash.c8
-rw-r--r--sys/dev/raidframe/rf_shutdown.c4
10 files changed, 31 insertions, 31 deletions
diff --git a/sys/arch/arm/arm/undefined.c b/sys/arch/arm/arm/undefined.c
index f93ea2c4844..636011b3a67 100644
--- a/sys/arch/arm/arm/undefined.c
+++ b/sys/arch/arm/arm/undefined.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: undefined.c,v 1.3 2006/12/24 20:30:35 miod Exp $ */
+/* $OpenBSD: undefined.c,v 1.4 2008/05/19 18:42:11 miod Exp $ */
/* $NetBSD: undefined.c,v 1.22 2003/11/29 22:21:29 bjh21 Exp $ */
/*
@@ -83,7 +83,7 @@ install_coproc_handler(int coproc, undef_handler_t handler)
KASSERT(handler != NULL); /* Used to be legal. */
/* XXX: M_TEMP??? */
- MALLOC(uh, struct undefined_handler *, sizeof(*uh), M_TEMP, M_WAITOK);
+ uh = (struct undefined_handler *)malloc(sizeof(*uh), M_TEMP, M_WAITOK);
uh->uh_handler = handler;
install_coproc_handler_static(coproc, uh);
return uh;
@@ -102,7 +102,7 @@ remove_coproc_handler(void *cookie)
struct undefined_handler *uh = cookie;
LIST_REMOVE(uh, uh_link);
- FREE(uh, M_TEMP);
+ free(uh, M_TEMP);
}
diff --git a/sys/arch/arm/xscale/pxa2x0_gpio.c b/sys/arch/arm/xscale/pxa2x0_gpio.c
index d9d932363aa..748e0535585 100644
--- a/sys/arch/arm/xscale/pxa2x0_gpio.c
+++ b/sys/arch/arm/xscale/pxa2x0_gpio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pxa2x0_gpio.c,v 1.19 2008/05/15 22:17:08 brad Exp $ */
+/* $OpenBSD: pxa2x0_gpio.c,v 1.20 2008/05/19 18:42:12 miod Exp $ */
/* $NetBSD: pxa2x0_gpio.c,v 1.2 2003/07/15 00:24:55 lukem Exp $ */
/*
@@ -230,7 +230,7 @@ pxa2x0_gpio_intr_establish(u_int gpio, int level, int spl, int (*func)(void *),
if (GPIO_FN_IS_OUT(pxa2x0_gpio_get_function(gpio)) != GPIO_IN)
panic("pxa2x0_gpio_intr_establish: Pin %d not GPIO_IN", gpio);
- MALLOC(gh, struct gpio_irq_handler *, sizeof(struct gpio_irq_handler),
+ gh = (struct gpio_irq_handler *)malloc(sizeof(struct gpio_irq_handler),
M_DEVBUF, M_NOWAIT);
gh->gh_func = func;
@@ -330,7 +330,7 @@ pxa2x0_gpio_intr_disestablish(void *cookie)
#endif /* PXAGPIO_HAS_GPION_INTRS */
}
- FREE(gh, M_DEVBUF);
+ free(gh, M_DEVBUF);
}
#ifdef PXAGPIO_HAS_GPION_INTRS
diff --git a/sys/arch/arm/xscale/pxa2x0_intr.c b/sys/arch/arm/xscale/pxa2x0_intr.c
index fc87784be3c..0ba419b4fac 100644
--- a/sys/arch/arm/xscale/pxa2x0_intr.c
+++ b/sys/arch/arm/xscale/pxa2x0_intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pxa2x0_intr.c,v 1.16 2008/05/15 22:17:08 brad Exp $ */
+/* $OpenBSD: pxa2x0_intr.c,v 1.17 2008/05/19 18:42:12 miod Exp $ */
/* $NetBSD: pxa2x0_intr.c,v 1.5 2003/07/15 00:24:55 lukem Exp $ */
/*
@@ -553,7 +553,7 @@ pxa2x0_intr_establish(int irqno, int level,
#ifdef MULTIPLE_HANDLERS_ON_ONE_IRQ
/* no point in sleeping unless someone can free memory. */
- MALLOC(ih, struct intrhand *, sizeof *ih, M_DEVBUF,
+ ih = (struct intrhand *)malloc(sizeof *ih, M_DEVBUF,
cold ? M_NOWAIT : M_WAITOK);
if (ih == NULL)
panic("intr_establish: can't malloc handler info");
@@ -599,7 +599,7 @@ pxa2x0_intr_disestablish(void *cookie)
psw = disable_interrupts(I32_bit);
TAILQ_REMOVE(&handler[irqno].list, ih, ih_list);
- FREE(ih, M_DEVBUF);
+ free(ih, M_DEVBUF);
pxa2x0_update_intr_masks();
diff --git a/sys/arch/hppa/hppa/intr.c b/sys/arch/hppa/hppa/intr.c
index 858e307d3a0..83af9991634 100644
--- a/sys/arch/hppa/hppa/intr.c
+++ b/sys/arch/hppa/hppa/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.24 2008/04/27 14:36:38 kettenis Exp $ */
+/* $OpenBSD: intr.c,v 1.25 2008/05/19 18:42:12 miod Exp $ */
/*
* Copyright (c) 2002-2004 Michael Shalayeff
@@ -173,14 +173,14 @@ cpu_intr_map(void *v, int pri, int irq, int (*handler)(void *), void *arg,
if (irq < 0 || irq >= CPU_NINTS)
return (NULL);
- MALLOC(cnt, struct evcount *, sizeof *cnt, M_DEVBUF, M_NOWAIT);
+ cnt = (struct evcount *)malloc(sizeof *cnt, M_DEVBUF, M_NOWAIT);
if (!cnt)
return (NULL);
iv = &ivb[irq];
if (iv->handler) {
if (!pv->share) {
- FREE(cnt, M_DEVBUF);
+ free(cnt, M_DEVBUF);
return (NULL);
} else {
iv = pv->share;
@@ -213,7 +213,7 @@ cpu_intr_establish(int pri, int irq, int (*handler)(void *), void *arg,
if (irq < 0 || irq >= CPU_NINTS || intr_table[irq].handler)
return (NULL);
- MALLOC(cnt, struct evcount *, sizeof *cnt, M_DEVBUF, M_NOWAIT);
+ cnt = (struct evcount *)malloc(sizeof *cnt, M_DEVBUF, M_NOWAIT);
if (!cnt)
return (NULL);
@@ -237,7 +237,7 @@ cpu_intr_establish(int pri, int irq, int (*handler)(void *), void *arg,
intr_more += 2 * CPU_NINTS;
for (ev = iv->next + CPU_NINTS; ev < intr_more; ev++)
ev->share = iv->share, iv->share = ev;
- FREE(cnt, M_DEVBUF);
+ free(cnt, M_DEVBUF);
iv->cnt = NULL;
} else
evcount_attach(cnt, name, NULL, &evcount_intr);
diff --git a/sys/arch/mac68k/dev/nubus.c b/sys/arch/mac68k/dev/nubus.c
index 6ca3c5c3b09..fb05fcc839c 100644
--- a/sys/arch/mac68k/dev/nubus.c
+++ b/sys/arch/mac68k/dev/nubus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nubus.c,v 1.33 2007/04/10 17:47:54 miod Exp $ */
+/* $OpenBSD: nubus.c,v 1.34 2008/05/19 18:42:12 miod Exp $ */
/* $NetBSD: nubus.c,v 1.53 2002/04/13 17:49:41 briggs Exp $ */
/*
@@ -771,7 +771,7 @@ nubus_get_smem_addr_rangelist(bst, bsh, fmt, dirent, data_return)
* malloc a block of (blocklen) bytes
* caller must recycle block after use
*/
- MALLOC(blocklist,caddr_t,blocklen,M_TEMP,M_WAITOK);
+ blocklist = (caddr_t)malloc(blocklen, M_TEMP, M_WAITOK);
/* read ((blocklen - 4) / 8) (length,offset) pairs into block */
nubus_get_ind_data(bst, bsh, fmt, dirent, blocklist, blocklen);
diff --git a/sys/arch/mac68k/mac68k/disksubr.c b/sys/arch/mac68k/mac68k/disksubr.c
index 48ffd0b8b7d..78525dd7b9e 100644
--- a/sys/arch/mac68k/mac68k/disksubr.c
+++ b/sys/arch/mac68k/mac68k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.51 2007/07/11 04:53:42 miod Exp $ */
+/* $OpenBSD: disksubr.c,v 1.52 2008/05/19 18:42:12 miod Exp $ */
/* $NetBSD: disksubr.c,v 1.22 1997/11/26 04:18:20 briggs Exp $ */
/*
@@ -267,8 +267,8 @@ read_mac_label(char *dlbuf, struct disklabel *lp)
int i, num_parts, maxslot = RAW_PART;
struct partmapentry *pmap;
- MALLOC(pmap, struct partmapentry *,
- NUM_PARTS_PROBED * sizeof(struct partmapentry), M_DEVBUF, M_NOWAIT);
+ pmap = (struct partmapentry *)malloc(NUM_PARTS_PROBED *
+ sizeof(struct partmapentry), M_DEVBUF, M_NOWAIT);
if (pmap == NULL)
return ("out of memory");
@@ -317,7 +317,7 @@ read_mac_label(char *dlbuf, struct disklabel *lp)
lp->d_version = 1;
lp->d_checksum = 0;
lp->d_checksum = dkcksum(lp);
- FREE(pmap, M_DEVBUF);
+ free(pmap, M_DEVBUF);
return NULL;
}
diff --git a/sys/arch/mvme68k/dev/ssh.c b/sys/arch/mvme68k/dev/ssh.c
index fd35217ec73..babe41225fc 100644
--- a/sys/arch/mvme68k/dev/ssh.c
+++ b/sys/arch/mvme68k/dev/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.16 2007/05/29 13:56:13 pyr Exp $ */
+/* $OpenBSD: ssh.c,v 1.17 2008/05/19 18:42:12 miod Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -500,8 +500,8 @@ sshinitialize(sc)
* malloc sc_acb to ensure that DS is on a long word boundary.
*/
- MALLOC(sc->sc_acb, struct ssh_acb *,
- sizeof(struct ssh_acb) * SSH_NACB, M_DEVBUF, M_NOWAIT);
+ sc->sc_acb = (struct ssh_acb *)malloc(sizeof(struct ssh_acb) *
+ SSH_NACB, M_DEVBUF, M_NOWAIT);
if (sc->sc_acb == NULL)
panic("sshinitialize: ACB malloc failed!");
diff --git a/sys/arch/mvme68k/dev/vs.c b/sys/arch/mvme68k/dev/vs.c
index 00089708651..30edbf054f9 100644
--- a/sys/arch/mvme68k/dev/vs.c
+++ b/sys/arch/mvme68k/dev/vs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vs.c,v 1.22 2007/10/06 02:18:38 krw Exp $ */
+/* $OpenBSD: vs.c,v 1.23 2008/05/19 18:42:12 miod Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
@@ -360,7 +360,7 @@ vs_scsicmd(xs)
cqep->cqe_WORK_QUEUE = slp->target + 1;
}
- MALLOC(m328_cmd, M328_CMD*, sizeof(M328_CMD), M_DEVBUF, M_WAITOK);
+ m328_cmd = (M328_CMD*)malloc(sizeof(M328_CMD), M_DEVBUF, M_WAITOK);
m328_cmd->xs = xs;
if (xs->datalen) {
diff --git a/sys/arch/zaurus/dev/zaurus_flash.c b/sys/arch/zaurus/dev/zaurus_flash.c
index cef7861152c..23dcfcb9b18 100644
--- a/sys/arch/zaurus/dev/zaurus_flash.c
+++ b/sys/arch/zaurus/dev/zaurus_flash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_flash.c,v 1.7 2008/04/18 06:42:21 djm Exp $ */
+/* $OpenBSD: zaurus_flash.c,v 1.8 2008/05/19 18:42:13 miod Exp $ */
/*
* Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org>
@@ -650,7 +650,7 @@ zflash_safe_start(struct zflash_softc *sc, dev_t dev)
phyuse = (u_int16_t *)malloc(sp->sp_pblks * sizeof(u_int16_t),
M_DEVBUF, M_NOWAIT);
if (phyuse == NULL) {
- FREE(sp, M_DEVBUF);
+ free(sp, M_DEVBUF);
return ENOMEM;
}
sp->sp_phyuse = phyuse;
@@ -659,8 +659,8 @@ zflash_safe_start(struct zflash_softc *sc, dev_t dev)
logmap = (u_int *)malloc(sp->sp_lblks * sizeof(u_int),
M_DEVBUF, M_NOWAIT);
if (logmap == NULL) {
- FREE(phyuse, M_DEVBUF);
- FREE(sp, M_DEVBUF);
+ free(phyuse, M_DEVBUF);
+ free(sp, M_DEVBUF);
return ENOMEM;
}
sp->sp_logmap = logmap;
diff --git a/sys/dev/raidframe/rf_shutdown.c b/sys/dev/raidframe/rf_shutdown.c
index be13f747f50..1ff9b585916 100644
--- a/sys/dev/raidframe/rf_shutdown.c
+++ b/sys/dev/raidframe/rf_shutdown.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rf_shutdown.c,v 1.5 2002/12/16 07:01:05 tdeval Exp $ */
+/* $OpenBSD: rf_shutdown.c,v 1.6 2008/05/19 18:42:13 miod Exp $ */
/* $NetBSD: rf_shutdown.c,v 1.6 2000/01/13 23:41:18 oster Exp $ */
/*
@@ -45,7 +45,7 @@ void rf_FreeShutdownEnt(RF_ShutdownList_t *);
void
rf_FreeShutdownEnt(RF_ShutdownList_t *ent)
{
- FREE(ent, M_RAIDFRAME);
+ free(ent, M_RAIDFRAME);
}
int