Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Sep 2013 23:16:38 +0200
From:      Davide Italiano <davide@freebsd.org>
To:        Hans Petter Selasky <hselasky@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r255067 - head/sys/kern
Message-ID:  <CACYV=-Gd3ip%2BukcNfwCUOVZ%2BySKLsY3-AD5=f3naHuKhYu9Uew@mail.gmail.com>
In-Reply-To: <201308301039.r7UAduI1052038@svn.freebsd.org>
References:  <201308301039.r7UAduI1052038@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> ==============================================================================
> --- head/sys/kern/kern_synch.c  Fri Aug 30 10:10:22 2013        (r255066)
> +++ head/sys/kern/kern_synch.c  Fri Aug 30 10:39:56 2013        (r255067)
> @@ -356,10 +356,7 @@ msleep_spin_sbt(void *ident, struct mtx
>  int
>  pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags)
>  {
> -       int sbt_sec;
> -
> -       sbt_sec = sbintime_getsec(sbt);
> -       KASSERT(sbt_sec >= 0, ("pause: timo must be >= 0"));
> +       KASSERT(sbt >= 0, ("pause: timeout must be >= 0"));
>

Hi Hans,
sorry for the late answer/review but I completely missed this patch
when you posted on mailing lists.
That said, I think this commit is correct and also makes the code more
readable. As an added bonus, this fixes a "bug" introduced while
hacking on callout rejuvenation. The original assertion was actually
checking for timo  >= 0 but when we switched to 'struct bintime' for
callout that assertion was changed to check for bt.sec >=0. After
that, when we introduced sbintime_t that assertion was never changed
back to his original form, which is more correct. Also, the assertion
message is more explicative, at least IMHO.

Thanks,

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACYV=-Gd3ip%2BukcNfwCUOVZ%2BySKLsY3-AD5=f3naHuKhYu9Uew>