Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 Aug 2016 19:40:44 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-threads@FreeBSD.org
Subject:   [Bug 210093] Redundant sq initialization in kern/subr_sleepqueue
Message-ID:  <bug-210093-16-WaiA10fbto@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-210093-16@https.bugs.freebsd.org/bugzilla/>
References:  <bug-210093-16@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D210093

John Baldwin <jhb@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |Closed
                 CC|                            |jhb@FreeBSD.org
         Resolution|---                         |Works As Intended

--- Comment #3 from John Baldwin <jhb@FreeBSD.org> ---
If the INVARIANTS block didn't have to define a variable we probably wouldn=
't
do it twice.  We could fix it but it would have to be a bit uglier:

#ifdef INVARIANTS
   int i;
#endif

   sq =3D td->td_sleepqueue;
#ifdef INVARIANTS
   for (i =3D 0; ...) {
   }
   ...
   sq->sq_lock =3D lock;
#endif
   ...

If our style permitted C99-type 'for (int i' that would be a simple way to
solve it, but it doesn't.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-210093-16-WaiA10fbto>