On Tue, Mar 17, 2015 at 12:09 PM, Peter Maydell
<peter.mayd...@linaro.org> wrote:
> On 17 March 2015 at 11:56, Stefan Hajnoczi <stefa...@redhat.com> wrote:
>> This commit was generated mechanically by coccinelle from the following
>> semantic patch:
>>
>> @@
>> expression val;
>> @@
>> - (ffs(val) - 1)
>> + ctz32(val)
>
> Did you check all these callsites to make sure that the value
> passed in can never be zero? (ffs(0) - 1) is -1 whereas
> ctz32(0) is 32...

I have done that now and found 2 cases where it's possible.  They will
be moved to separate patches in v2.

Stefan

Reply via email to