Module Name:    src
Committed By:   pooka
Date:           Thu Apr 24 12:04:28 UTC 2014

Modified Files:
        src/sys/kern: kern_sleepq.c
        src/sys/rump/librump/rumpkern: sleepq.c
        src/sys/sys: sleepq.h

Log Message:
Make sleepq_wake() type void.  The return value hasn't been used in
almost 6 years.  Even if it were, returning an arbitrary lwp is a bit
of a wonky interface and can really work only when expected == 1.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/kern/kern_sleepq.c
cvs rdiff -u -r1.15 -r1.16 src/sys/rump/librump/rumpkern/sleepq.c
cvs rdiff -u -r1.22 -r1.23 src/sys/sys/sleepq.h

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/kern_sleepq.c
diff -u src/sys/kern/kern_sleepq.c:1.48 src/sys/kern/kern_sleepq.c:1.49
--- src/sys/kern/kern_sleepq.c:1.48	Fri Mar  8 08:35:09 2013
+++ src/sys/kern/kern_sleepq.c	Thu Apr 24 12:04:28 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sleepq.c,v 1.48 2013/03/08 08:35:09 apb Exp $	*/
+/*	$NetBSD: kern_sleepq.c,v 1.49 2014/04/24 12:04:28 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sleepq.c,v 1.48 2013/03/08 08:35:09 apb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sleepq.c,v 1.49 2014/04/24 12:04:28 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -307,7 +307,7 @@ sleepq_block(int timo, bool catch)
  *
  *	Wake zero or more LWPs blocked on a single wait channel.
  */
-lwp_t *
+void
 sleepq_wake(sleepq_t *sq, wchan_t wchan, u_int expected, kmutex_t *mp)
 {
 	lwp_t *l, *next;
@@ -326,7 +326,6 @@ sleepq_wake(sleepq_t *sq, wchan_t wchan,
 	}
 
 	mutex_spin_exit(mp);
-	return l;
 }
 
 /*

Index: src/sys/rump/librump/rumpkern/sleepq.c
diff -u src/sys/rump/librump/rumpkern/sleepq.c:1.15 src/sys/rump/librump/rumpkern/sleepq.c:1.16
--- src/sys/rump/librump/rumpkern/sleepq.c:1.15	Thu Apr 24 11:56:11 2014
+++ src/sys/rump/librump/rumpkern/sleepq.c	Thu Apr 24 12:04:28 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sleepq.c,v 1.15 2014/04/24 11:56:11 pooka Exp $	*/
+/*	$NetBSD: sleepq.c,v 1.16 2014/04/24 12:04:28 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sleepq.c,v 1.15 2014/04/24 11:56:11 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sleepq.c,v 1.16 2014/04/24 12:04:28 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/condvar.h>
@@ -99,7 +99,7 @@ sleepq_block(int timo, bool catch)
 	return error;
 }
 
-lwp_t *
+void
 sleepq_wake(sleepq_t *sq, wchan_t wchan, u_int expected, kmutex_t *mp)
 {
 	struct lwp *l, *l_next;
@@ -120,7 +120,6 @@ sleepq_wake(sleepq_t *sq, wchan_t wchan,
 		cv_broadcast(&sq_cv);
 
 	mutex_spin_exit(mp);
-	return NULL;
 }
 
 void

Index: src/sys/sys/sleepq.h
diff -u src/sys/sys/sleepq.h:1.22 src/sys/sys/sleepq.h:1.23
--- src/sys/sys/sleepq.h:1.22	Sun Feb 19 21:07:00 2012
+++ src/sys/sys/sleepq.h	Thu Apr 24 12:04:28 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sleepq.h,v 1.22 2012/02/19 21:07:00 rmind Exp $	*/
+/*	$NetBSD: sleepq.h,v 1.23 2014/04/24 12:04:28 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@ void	sleepq_remove(sleepq_t *, lwp_t *);
 void	sleepq_enqueue(sleepq_t *, wchan_t, const char *, syncobj_t *);
 void	sleepq_unsleep(lwp_t *, bool);
 void	sleepq_timeout(void *);
-lwp_t	*sleepq_wake(sleepq_t *, wchan_t, u_int, kmutex_t *);
+void	sleepq_wake(sleepq_t *, wchan_t, u_int, kmutex_t *);
 int	sleepq_abort(kmutex_t *, int);
 void	sleepq_changepri(lwp_t *, pri_t);
 void	sleepq_lendpri(lwp_t *, pri_t);

Reply via email to