From owner-freebsd-current@FreeBSD.ORG Thu Dec 4 17:18:54 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 771781065672 for ; Thu, 4 Dec 2008 17:18:54 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.230]) by mx1.freebsd.org (Postfix) with ESMTP id 484568FC14 for ; Thu, 4 Dec 2008 17:18:54 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so3972407rvf.43 for ; Thu, 04 Dec 2008 09:18:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=+zNPmSioUn0wV18XZkzLfCnVuZxeDiuDOgPsuLtCYdE=; b=Pt9YnBEEAcGv5U2eOKPwUICV7eDInihwiLtQpLBvBbHWmBIqKnKQfvMfH2yigDJiXN KEQiETPrVVDVbcFFS6mjCyjj8ECWM1RvwVIjwpFl6LNlKYQwYWK9f/TLKlCYXBLRwRUH PQfpRUk9qVv/YGDdTY1llvWmSSTGaz/C2RL9c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=R74Tol9ijjcRm9N1Ew7cB8Z25vuYJjvU/QlyTpMKEeS4Dy4iTSu5CDLoMrEmKB+QQ0 Mn4j2IgcdyM1t3QICDSqCmRltMgNCrRBxFHT5vsv09xTUZk+bl42195bsV5rqbF3c1D7 lWYki4PkPdpefbCCxkpviL6ApP7GP7J37Xgc0= Received: by 10.140.177.15 with SMTP id z15mr7053337rve.17.1228411129227; Thu, 04 Dec 2008 09:18:49 -0800 (PST) Received: by 10.140.177.21 with HTTP; Thu, 4 Dec 2008 09:18:49 -0800 (PST) Message-ID: Date: Thu, 4 Dec 2008 09:18:49 -0800 From: "Maksim Yevmenkin" To: "Eygene Ryabinkin" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7d6fde3d0812040324y3bf0901cy1f4a6d961362c314@mail.gmail.com> Cc: Garrett Cooper , "current@freebsd.org" 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 17:18:54 -0000 On Thu, Dec 4, 2008 at 3:33 AM, Eygene Ryabinkin wrote: > 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 = 1 for int N != 0, so it is the way to > turn N != 0 to one. yep, that was the idea. > Triple negation? I am out of guesses, because it > seems redundant to me: !0 = 1, !5 = 0, so adding another two negations > is seem to be worthless. well, that's just silly typo (blame my sticky fingers). you are correct single negation should work just as good :) thanks for catching this guys, i fixed it. thanks, max > -- > Eygene > _ ___ _.--. # > \`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard > / ' ` , __.--' # to read the on-line manual > )/' _/ \ `-_, / # while single-stepping the kernel. > `-'" `"\_ ,_.-;_.-\_ ', fsc/as # > _.-'_./ {_.' ; / # -- FreeBSD Developers handbook > {_.-``-' {_/ # >