From owner-freebsd-current@FreeBSD.ORG Thu Dec 4 11:52:31 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C46F2106564A for ; Thu, 4 Dec 2008 11:52:31 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 5EF2C8FC12 for ; Thu, 4 Dec 2008 11:52:31 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) DomainKey-Signature: a=rsa-sha1; q=dns; c=simple; s=one; d=codelabs.ru; h=Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:Sender; b=VnTh1On6mmijxnPTlQX+BoKOMAcYdcMc8p3IL4v4pypla0xFDi9VlBWJT1NRi8JgfBWzeJ2KG6g/zy5SheGy79f5Qt0ewj/fll68nSgUVyrAN9Zt9SR0EZt8lJiMirNRERRgiVyef1Ha8uRtPHFbh0AqONh37mf5FIRhyrAwj2M=; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1L8CSf-000CT5-A0; Thu, 04 Dec 2008 14:33:37 +0300 Date: Thu, 4 Dec 2008 14:33:36 +0300 From: Eygene Ryabinkin To: Garrett Cooper Message-ID: References: <7d6fde3d0812040324y3bf0901cy1f4a6d961362c314@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OrT4iOlIQZp3kw4S" Content-Disposition: inline In-Reply-To: <7d6fde3d0812040324y3bf0901cy1f4a6d961362c314@mail.gmail.com> Sender: rea-fbsd@codelabs.ru Cc: "current@freebsd.org" , Maksim Yevmenkin Subject: Re: RFC: small syscons and kbd patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2008 11:52:31 -0000 --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--