Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/sys/dev/ic Pull up following revision(s) (requested by bo...



details:   https://anonhg.NetBSD.org/src/rev/8a42ae2000dd
branches:  netbsd-6
changeset: 774569:8a42ae2000dd
user:      riz <riz%NetBSD.org@localhost>
date:      Mon Sep 03 18:38:34 2012 +0000

description:
Pull up following revision(s) (requested by bouyer in ticket #524):
        sys/dev/ic/isp_netbsd.c: revision 1.86
Properly fill the struct timeval before using it: a timeout in microseconds has
to be converted to seconds and microseconds.
Fix KASSERT("usec >= 0 && usec < 1000000") in tvtohz().
While there, simplify computation of to (avoids a timersub() in tvhzto()
and directly call tvtohz() with the interval).

diffstat:

 sys/dev/ic/isp_netbsd.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (37 lines):

diff -r fa57e1260efd -r 8a42ae2000dd sys/dev/ic/isp_netbsd.c
--- a/sys/dev/ic/isp_netbsd.c   Mon Sep 03 18:36:33 2012 +0000
+++ b/sys/dev/ic/isp_netbsd.c   Mon Sep 03 18:38:34 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_netbsd.c,v 1.85 2011/12/12 18:28:34 jdc Exp $ */
+/* $NetBSD: isp_netbsd.c,v 1.85.2.1 2012/09/03 18:38:34 riz Exp $ */
 /*
  * Platform (NetBSD) dependent common attachment code for Qlogic adapters.
  */
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.85 2011/12/12 18:28:34 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.85.2.1 2012/09/03 18:38:34 riz Exp $");
 
 #include <dev/ic/isp_netbsd.h>
 #include <dev/ic/isp_ioctl.h>
@@ -1603,14 +1603,14 @@
                tv.tv_sec = 0;
                tv.tv_usec = 0;
                for (olim = 0; olim < maxc; olim++) {
-                       utv.tv_sec = 0;
-                       utv.tv_usec = usecs;
+                       utv.tv_sec = usecs / 1000000;
+                       utv.tv_usec = usecs % 1000000;
                        timeradd(&tv, &utv, &tv);
                }
-               timeradd(&tv, &start, &tv);
-               to = tvhzto(&tv);
+               to = tvtohz(&tv);
                if (to == 0)
                        to = 1;
+               timeradd(&tv, &start, &tv);
 
                isp->isp_osinfo.mbox_sleep_ok = 0;
                isp->isp_osinfo.mbox_sleeping = 1;



Home | Main Index | Thread Index | Old Index