Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Don't cast a pointer void * before passing to memse...
details: https://anonhg.NetBSD.org/src/rev/32e871b32e8b
branches: trunk
changeset: 766705:32e871b32e8b
user: dyoung <dyoung%NetBSD.org@localhost>
date: Thu Jun 30 22:38:50 2011 +0000
description:
Don't cast a pointer void * before passing to memset(), that's not
necessary. Use NULL instead of (type *)0. This patch produces no
change in the generated assembly.
diffstat:
sys/kern/sys_socket.c | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
diffs (54 lines):
diff -r 8d4081e7ac88 -r 32e871b32e8b sys/kern/sys_socket.c
--- a/sys/kern/sys_socket.c Thu Jun 30 22:13:02 2011 +0000
+++ b/sys/kern/sys_socket.c Thu Jun 30 22:38:50 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sys_socket.c,v 1.63 2009/12/20 09:36:06 dsl Exp $ */
+/* $NetBSD: sys_socket.c,v 1.64 2011/06/30 22:38:50 dyoung Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_socket.c,v 1.63 2009/12/20 09:36:06 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_socket.c,v 1.64 2011/06/30 22:38:50 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -100,8 +100,7 @@
struct socket *so = fp->f_data;
int error;
- error = (*so->so_receive)(so, (struct mbuf **)0,
- uio, (struct mbuf **)0, (struct mbuf **)0, (int *)0);
+ error = (*so->so_receive)(so, NULL, uio, NULL, NULL, NULL);
return error;
}
@@ -114,8 +113,7 @@
struct socket *so = fp->f_data;
int error;
- error = (*so->so_send)(so, (struct mbuf *)0,
- uio, (struct mbuf *)0, (struct mbuf *)0, 0, curlwp);
+ error = (*so->so_send)(so, NULL, uio, NULL, NULL, 0, curlwp);
return error;
}
@@ -234,13 +232,12 @@
struct socket *so = fp->f_data;
int error;
- memset((void *)ub, 0, sizeof(*ub));
+ memset(ub, 0, sizeof(*ub));
ub->st_mode = S_IFSOCK;
solock(so);
error = (*so->so_proto->pr_usrreq)(so, PRU_SENSE,
- (struct mbuf *)ub, (struct mbuf *)0, (struct mbuf *)0,
- curlwp);
+ (struct mbuf *)ub, NULL, NULL, curlwp);
sounlock(so);
return error;
Home |
Main Index |
Thread Index |
Old Index