From owner-svn-src-head@FreeBSD.ORG Sun Nov 20 08:29:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10DEB106564A; Sun, 20 Nov 2011 08:29:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 008468FC08; Sun, 20 Nov 2011 08:29:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAK8TNSj082617; Sun, 20 Nov 2011 08:29:23 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAK8TNm7082615; Sun, 20 Nov 2011 08:29:23 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111200829.pAK8TNm7082615@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 20 Nov 2011 08:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227748 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2011 08:29:24 -0000 Author: hselasky Date: Sun Nov 20 08:29:23 2011 New Revision: 227748 URL: http://svn.freebsd.org/changeset/base/227748 Log: Minor style change: Simplify the description of pause() and shorten the KASSERT message in pause. Also add a clamp for the timo argument in the non-KASSERT case. Suggested by: Bruce Evans MFC after: 1 week Modified: head/sys/kern/kern_synch.c Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Sun Nov 20 05:32:12 2011 (r227747) +++ head/sys/kern/kern_synch.c Sun Nov 20 08:29:23 2011 (r227748) @@ -325,25 +325,24 @@ msleep_spin(void *ident, struct mtx *mtx } /* - * pause() is almost like tsleep() except that the intention is to not - * be explicitly woken up by another thread. Instead, the current - * thread simply wishes to sleep until the timeout expires. It is - * implemented using a dummy wait channel. During cold bootup pause() - * will use the DELAY() function instead of tsleep() to wait the given - * number of system ticks. The passed "timo" argument must not be - * negative and also greater than zero. + * pause() delays the calling thread by the given number of system ticks. + * During cold bootup, pause() uses the DELAY() function instead of + * the tsleep() function to do the waiting. The "timo" argument must be + * greater than zero. */ int pause(const char *wmesg, int timo) { + KASSERT(timo > 0, ("pause: timo must be > 0")); - KASSERT(timo > 0, ("pause: a positive and non-zero " - "timeout is required")); + /* silently convert invalid timeouts */ + if (timo < 1) + timo = 1; if (cold) { /* * We delay one HZ at a time to avoid overflowing the - * DELAY() argument: + * system specific DELAY() function(s): */ while (timo >= hz) { DELAY(1000000);