On 14.03.2022 16:32, Roger Pau Monné wrote:
> On Mon, Feb 14, 2022 at 05:44:01PM +0100, Jan Beulich wrote:
>> On 01.02.2022 17:46, Roger Pau Monne wrote:
>>> + ASSERT(core->count <= c->x86_num_siblings);
>>> + if ((enable && core->count == 1) ||
>>> + (!enable && core->count == 0))
>>
>> Maybe simply "if ( core->count == enable )"? Or do compilers not like
>> comparisons with booleans?
>
> I had it like that, but decided to switch to the current code just
> before sending because I think it's clearer. I didn't get complaints
> from compilers, but I felt it was kind of abusing to compare a boolean
> with and integer.
>
> If you wish I can restore to that form.
Well, if you don't like that alternative form, and since I don't like
the redundancy, how about
if ( enable ? core->count == 1 : !core->count )
? It was actually via this transformation how I landed at what I did
suggest.
Jan