Module Name:    src
Committed By:   dyoung
Date:           Thu Jun 30 22:38:50 UTC 2011

Modified Files:
        src/sys/kern: sys_socket.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/kern/sys_socket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/sys_socket.c
diff -u src/sys/kern/sys_socket.c:1.63 src/sys/kern/sys_socket.c:1.64
--- src/sys/kern/sys_socket.c:1.63	Sun Dec 20 09:36:06 2009
+++ src/sys/kern/sys_socket.c	Thu Jun 30 22:38:50 2011
@@ -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;

Reply via email to