On Wed, 26 Nov 2025, Yaroslav <[email protected]> wrote:
> On 2025-11-26 15:19, Jani Nikula wrote:
>> On Wed, 26 Nov 2025, Yaroslav Bolyukin <[email protected]> wrote:
>>> +   if (type_7 && FIELD_GET(DISPLAYID_BLOCK_REV, block->rev) >= 1)
>>> +           mode->dsc_passthrough_timings_support =
>>> +                   !!(block->rev & 
>>> DISPLAYID_BLOCK_PASSTHROUGH_TIMINGS_SUPPORT);
>> 
>> The !! and parentheses are superfluous.
>> 
>
> Most of the other instances of bitflag parsing logic in kernel seem to 
> cast integers to booleans explicitly this way.
>
> I'm fine with simplifying that, I was only doing what everyone else does.

I get that, but such habits originate from the days before std bool. !!
normalizes ints to 0 and 1, but assigning to bool does the same for you.

BR,
Jani.


-- 
Jani Nikula, Intel

Reply via email to