Date: Thu, 4 Dec 2008 14:33:36 +0300 From: Eygene Ryabinkin <rea-fbsd@codelabs.ru> To: Garrett Cooper <yanefbsd@gmail.com> Cc: "current@freebsd.org" <current@freebsd.org>, Maksim Yevmenkin <maksim.yevmenkin@gmail.com> Subject: Re: RFC: small syscons and kbd patch Message-ID: <XyF%2B8oK9MN%2BR7Vvh5BW2XWkYOoE@yY%2BfOhC1VHEMJMRMqdV4xmT5mXM> In-Reply-To: <7d6fde3d0812040324y3bf0901cy1f4a6d961362c314@mail.gmail.com> References: <bb4a86c70812021701i621fdcfjb6a58a7f5cf781d5@mail.gmail.com> <7d6fde3d0812040324y3bf0901cy1f4a6d961362c314@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--OrT4iOlIQZp3kw4S Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Garrett, good day. Thu, Dec 04, 2008 at 03:24:28AM -0800, Garrett Cooper wrote: > On Tue, Dec 2, 2008 at 5:01 PM, Maksim Yevmenkin > Why are you double and triple negating on this line? > + return (atomic_cmpset_acq_int(&kbd->kb_locked, !!!on, !!on)); Double negation is easy -- !!N =3D 1 for int N !=3D 0, so it is the way to turn N !=3D 0 to one. Triple negation? I am out of guesses, because it seems redundant to me: !0 =3D 1, !5 =3D 0, so adding another two negations is seem to be worthless. --=20 Eygene _ ___ _.--. # \`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard / ' ` , __.--' # to read the on-line manual =20 )/' _/ \ `-_, / # while single-stepping the kernel. `-'" `"\_ ,_.-;_.-\_ ', fsc/as # _.-'_./ {_.' ; / # -- FreeBSD Developers handbook=20 {_.-``-' {_/ # --OrT4iOlIQZp3kw4S Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkk3wBAACgkQthUKNsbL7YjMEACeIaOZ3fxrLIysu8d6X+tDfPX1 +vsAnjQaOLa+UHKgWI+shaKzTWJahzDB =s0Ov -----END PGP SIGNATURE----- --OrT4iOlIQZp3kw4S--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XyF%2B8oK9MN%2BR7Vvh5BW2XWkYOoE>