From 66f807ed8b3634dc73d9f7526c484e43f094c0ee Mon Sep 17 00:00:00 2001 From: des Date: Thu, 23 Oct 2008 15:53:51 +0000 Subject: Retire the MALLOC and FREE macros. They are an abomination unto style(9). MFC after: 3 months --- sys/compat/linux/linux_ioctl.c | 4 ++-- sys/compat/linux/linux_socket.c | 6 +++--- sys/compat/linux/linux_util.c | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'sys/compat') diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 9f16817..df081a7 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -2673,7 +2673,7 @@ linux_ioctl_register_handler(struct linux_ioctl_handler *h) break; } if (he == NULL) { - MALLOC(he, struct handler_element *, sizeof(*he), + he = malloc(sizeof(*he), M_LINUX, M_WAITOK); he->func = h->func; } else @@ -2711,7 +2711,7 @@ linux_ioctl_unregister_handler(struct linux_ioctl_handler *h) if (he->func == h->func) { TAILQ_REMOVE(&handlers, he, list); sx_xunlock(&linux_ioctl_sx); - FREE(he, M_LINUX); + free(he, M_LINUX); return (0); } } diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 24a7a81..57051aa 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -120,7 +120,7 @@ do_sa_get(struct sockaddr **sap, const struct osockaddr *osa, int *osalen, } #endif - MALLOC(kosa, struct osockaddr *, alloclen, mtype, M_WAITOK); + kosa = malloc(alloclen, mtype, M_WAITOK); if ((error = copyin(osa, kosa, *osalen))) goto out; @@ -168,7 +168,7 @@ do_sa_get(struct sockaddr **sap, const struct osockaddr *osa, int *osalen, return (0); out: - FREE(kosa, mtype); + free(kosa, mtype); return (error); } @@ -458,7 +458,7 @@ linux_sendit(struct thread *td, int s, struct msghdr *mp, int flags, bad: if (to) - FREE(to, M_SONAME); + free(to, M_SONAME); return (error); } diff --git a/sys/compat/linux/linux_util.c b/sys/compat/linux/linux_util.c index 51a0ec3..3412c37 100644 --- a/sys/compat/linux/linux_util.c +++ b/sys/compat/linux/linux_util.c @@ -165,7 +165,7 @@ linux_get_char_devices() char formated[256]; int current_size = 0, string_size = 1024; - MALLOC(string, char *, string_size, M_LINUX, M_WAITOK); + string = malloc(string_size, M_LINUX, M_WAITOK); string[0] = '\000'; last = ""; TAILQ_FOREACH(de, &devices, list) { @@ -181,10 +181,10 @@ linux_get_char_devices() if (strlen(formated) + current_size >= string_size) { string_size *= 2; - MALLOC(string, char *, string_size, + string = malloc(string_size, M_LINUX, M_WAITOK); bcopy(temp, string, current_size); - FREE(temp, M_LINUX); + free(temp, M_LINUX); } strcat(string, formated); current_size = strlen(string); @@ -197,7 +197,7 @@ linux_get_char_devices() void linux_free_get_char_devices(char *string) { - FREE(string, M_LINUX); + free(string, M_LINUX); } static int linux_major_starting = 200; @@ -210,7 +210,7 @@ linux_device_register_handler(struct linux_device_handler *d) if (d == NULL) return (EINVAL); - MALLOC(de, struct device_element *, sizeof(*de), + de = malloc(sizeof(*de), M_LINUX, M_WAITOK); if (d->linux_major < 0) { d->linux_major = linux_major_starting++; @@ -234,7 +234,7 @@ linux_device_unregister_handler(struct linux_device_handler *d) TAILQ_FOREACH(de, &devices, list) { if (bcmp(d, &de->entry, sizeof(*d)) == 0) { TAILQ_REMOVE(&devices, de, list); - FREE(de, M_LINUX); + free(de, M_LINUX); return (0); } } -- cgit v1.1