Re: [PATCH v8 2/6] platform: arm64: Add driver for EC found on Qualcomm reference devices
From: Konrad Dybcio
Date: Mon May 11 2026 - 08:14:03 EST
On 5/11/26 2:07 PM, Ilpo Järvinen wrote:
> On Mon, 11 May 2026, Anvesh Jain P wrote:
[...]
>>>> +static int qcom_ec_sci_evt_control(struct device *dev, bool enable)
>>>> +{
>>>> + struct i2c_client *client = to_i2c_client(dev);
>>>> +
>>>> + return i2c_smbus_write_byte_data(client, EC_SCI_EVT_CONTROL_CMD, !!enable);
>>>
>>> This converts bool -> u8 using C's implicit conversion rules (plus on top
>>> of that does unnecessary !!). Please write the conversion explicitly, you
>>> can use ?: syntax for brevity.
>>>
>>
>> The original v4 code used `enable ? 1 : 0` explicitly, but Konrad Dybcio
>> suggested switching to `!!enable` during his review [1]. Happy to revert
>> to the explicit form if that's the preferred style — just want to flag
>> the conflict so everyone is aligned.
>>
>> [1]
>> https://lore.kernel.org/all/6eb3a173-c364-431f-93e4-7bbb7a32431e@xxxxxxxxxxxxxxxx/
>
> I prefer to have the boolean to binary conversion done explicitly
> (with the platform drivers maintainer hat on).
And I won't object if you prefer that
Konrad