Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jun 2010 07:52:58 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r209416 - stable/7/sys/dev/amdsbwd
Message-ID:  <201006220752.o5M7qwJ1080108@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Tue Jun 22 07:52:58 2010
New Revision: 209416
URL: http://svn.freebsd.org/changeset/base/209416

Log:
  MFC r208670: amdsbwd: fix nonsensical timeout calculations

Modified:
  stable/7/sys/dev/amdsbwd/amdsbwd.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/amdsbwd/amdsbwd.c
==============================================================================
--- stable/7/sys/dev/amdsbwd/amdsbwd.c	Tue Jun 22 07:46:54 2010	(r209415)
+++ stable/7/sys/dev/amdsbwd/amdsbwd.c	Tue Jun 22 07:52:58 2010	(r209416)
@@ -230,10 +230,10 @@ amdsbwd_event(void *arg, unsigned int cm
 	cmd &= WD_INTERVAL;
 	if (cmd < WD_TO_1SEC)
 		cmd = 0;
-	timeout = ((uint64_t)1 << (cmd - WD_TO_1MS)) / sc->ms_per_tick;
-	if (timeout > sc->max_ticks)
-		timeout = sc->max_ticks;
 	if (cmd) {
+		timeout = ((uint64_t)1 << (cmd - WD_TO_1MS)) / sc->ms_per_tick;
+		if (timeout > sc->max_ticks)
+			timeout = sc->max_ticks;
 		if (timeout != sc->timeout) {
 			amdsbwd_tmr_set(sc, timeout);
 			if (!sc->active)



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