lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 07 Nov 2007 11:17:12 +0200
From:	Boaz Harrosh <bharrosh@...asas.com>
To:	"Robert P. J. Day" <rpjday@...shcourse.ca>
CC:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Add the macro to test if "exactly_one_bit_set" to log2.h.

On Tue, Nov 06 2007 at 20:53 +0200, "Robert P. J. Day" <rpjday@...shcourse.ca> wrote:
> On Tue, 6 Nov 2007, Boaz Harrosh wrote:
> 
>> On Tue, Nov 06 2007 at 18:38 +0200, "Robert P. J. Day" <rpjday@...shcourse.ca> wrote:
>>> While this macro is defined in terms of "is_power_of_2" and is
>>> therefore functionally equivalent, the visual semantics are sometimes
>>> more appropriate for what is actually being tested.
>>>
>>> Signed-off-by: Robert P. J. Day <rpjday@...shcourse.ca>
>>>
>>> ---
>>>
>>> diff --git a/include/linux/log2.h b/include/linux/log2.h
>>> index c8cf5e8..d0d324e 100644
>>> --- a/include/linux/log2.h
>>> +++ b/include/linux/log2.h
>>> @@ -55,6 +55,12 @@ bool is_power_of_2(unsigned long n)
>>>  }
>>>
>>>  /*
>>> + *  And for folks who want slightly different semantics ...
>>> + */
>>> +
>>> +#define exactly_one_bit_set is_power_of_2
>> at_most_one_bit_set No?
> 
> no, it really is *exactly* one bit set.  zero is not considered a
> power of two.
> 
> rday

Yes, Sorry for the noise it was late and I should have returned to
the kids instead of reading lkml.

Boaz
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ