Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2013 20:20:21 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r247418 - projects/calloutng/sys/kern
Message-ID:  <201302272020.r1RKKLPD089977@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Feb 27 20:20:21 2013
New Revision: 247418
URL: http://svnweb.freebsd.org/changeset/base/247418

Log:
  Use INT64_MAX for unset cc_firstevent to remove extra comparison.

Modified:
  projects/calloutng/sys/kern/kern_timeout.c

Modified: projects/calloutng/sys/kern/kern_timeout.c
==============================================================================
--- projects/calloutng/sys/kern/kern_timeout.c	Wed Feb 27 20:16:30 2013	(r247417)
+++ projects/calloutng/sys/kern/kern_timeout.c	Wed Feb 27 20:20:21 2013	(r247418)
@@ -128,7 +128,7 @@ struct cc_exec {
 };
 
 /*
- * There is one struct callou_cpu per cpu, holding all relevant
+ * There is one struct callout_cpu per cpu, holding all relevant
  * state for the callout processing thread on the individual CPU.
  */
 struct callout_cpu {
@@ -277,6 +277,7 @@ callout_cpu_init(struct callout_cpu *cc)
 		TAILQ_INIT(&cc->cc_callwheel[i]);
 	}
 	TAILQ_INIT(&cc->cc_expireq);
+	cc->cc_firstevent = INT64_MAX;
 	for (i = 0; i < 2; i++)
 		cc_cme_cleanup(cc, i);
 	if (cc->cc_callout == NULL)
@@ -560,7 +561,7 @@ callout_cc_add(struct callout *c, struct
 	 * that has been inserted, but only if really required.
 	 */
 	sbt = c->c_time + c->c_precision;
-	if (sbt < cc->cc_firstevent || cc->cc_firstevent == 0) {
+	if (sbt < cc->cc_firstevent) {
 		cc->cc_firstevent = sbt;
 		cpu_new_callout(cpu, sbt, c->c_time);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302272020.r1RKKLPD089977>