Re: [PATCH v1 1/1] x86/percpu: Cast -1 to argument type when comparing in percpu_add_op()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/16/24 11:20, Andy Shevchenko wrote:
>> Maybe more readable, but wouldn't it be theoretically buggy for u64?
>> I'm talking about the case when u64 == UINT_MAX, which will be true
>> in your case and false in mine.
>>
>>>         const int pao_ID__ = (__builtin_constant_p(val) &&
>>>                               ((val) == 1 || (int)(val) == -1)) ?
>>>
>>>                                 (int)(val) : 0;
> This code _is_ buggy, thanks to my new test case.
> 
> [   66.161375] pcp -1 (0xffffffffffffffff) != expected 4294967295 (0xffffffff)

Thanks for pointing that out Andy (and Peter too)!




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux