Re: RFC: small syscons and kbd patch

From: Eygene Ryabinkin <rea-fbsd_at_codelabs.ru>
Date: Thu, 4 Dec 2008 14:33:36 +0300
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.  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.
-- 
Eygene
 _                ___       _.--.   #
 \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
 /  ' `         ,       __.--'      #  to read the on-line manual   
 )/' _/     \   `-_,   /            #  while single-stepping the kernel.
 `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
     _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook 
    {_.-``-'         {_/            #

Received on Thu Dec 04 2008 - 10:52:31 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:38 UTC