Re: [PATCH v2 2/2] cpufreq: simplify setpolicy/target check in driver verification
From: Viresh Kumar
Date: Thu Aug 21 2025 - 05:59:02 EST
On 21-08-25, 17:45, Zihuan Zhang wrote:
> Do you have any suggestions on how to better test or handle the cases where
> driver registration could fail?
That's what I suggested earlier.
> > I would rather do:
> >
> > (!!driver_data->setpolicy == (driver_data->target_index || driver_data->target))
>
> The current version of the code is much better and safer.
You can actually do this.. This first converts
`driver_data->setpolicy` to bool and then compares both of them, and
both can't be true or false.
--
viresh