From 44f3212afbbcc65333a555e8d05bf766e1f32697 Mon Sep 17 00:00:00 2001 From: tedu Date: Sun, 13 Jul 2014 15:48:41 +0000 Subject: [PATCH] trim some casts --- sys/kern/kern_subr.c | 4 ++-- sys/kern/sys_generic.c | 4 ++-- sys/kern/vfs_bio.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index 1c0c44752bb..596032ad100 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_subr.c,v 1.39 2014/07/13 15:29:04 tedu Exp $ */ +/* $OpenBSD: kern_subr.c,v 1.40 2014/07/13 15:48:41 tedu Exp $ */ /* $NetBSD: kern_subr.c,v 1.15 1996/04/09 17:21:56 ragge Exp $ */ /* @@ -192,7 +192,7 @@ hook_establish(struct hook_desc_head *head, int tail, void (*fn)(void *), { struct hook_desc *hdp; - hdp = (struct hook_desc *)malloc(sizeof (*hdp), M_DEVBUF, M_NOWAIT); + hdp = malloc(sizeof(*hdp), M_DEVBUF, M_NOWAIT); if (hdp == NULL) return (NULL); diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index b62f44e6722..1694640f1dc 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_generic.c,v 1.91 2014/07/13 15:29:04 tedu Exp $ */ +/* $OpenBSD: sys_generic.c,v 1.92 2014/07/13 15:48:41 tedu Exp $ */ /* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */ /* @@ -945,7 +945,7 @@ doppoll(struct proc *p, struct pollfd *fds, u_int nfds, /* optimize for the default case, of a small nfds value */ if (sz > sizeof(pfds)) - pl = (struct pollfd *) malloc(sz, M_TEMP, M_WAITOK); + pl = malloc(sz, M_TEMP, M_WAITOK); if ((error = copyin(fds, pl, sz)) != 0) goto bad; diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 19d80b31af2..51e19fed7b6 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_bio.c,v 1.159 2014/07/13 15:29:04 tedu Exp $ */ +/* $OpenBSD: vfs_bio.c,v 1.160 2014/07/13 15:48:41 tedu Exp $ */ /* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */ /* @@ -441,7 +441,7 @@ bread_cluster(struct vnode *vp, daddr_t blkno, int size, struct buf **rbpp) if (howmany > maxra) howmany = maxra; - xbpp = mallocarray((howmany + 1), sizeof(struct buf *), M_TEMP, M_NOWAIT); + xbpp = mallocarray(howmany + 1, sizeof(struct buf *), M_TEMP, M_NOWAIT); if (xbpp == NULL) goto out; -- 2.20.1