Re: [PATCH v4 08/16] HID: ft260: uart: add modem pins control via ioctl
From: Michael Zaidman
Date: Wed Nov 18 2026 - 11:40:19 EST
On Tue, Nov 17, 2026 at 11:56:36PM +0000, Maarten Brock wrote:
>> + if (value)
>> + gpio->vals |= !!value << offset;
>
> Odd choice of asymmetry: !!value == true, then converted to int and shifted up.
>
>> + else
>> + gpio->vals &= ~BIT(offset);
>
> And here you choose to use BIT().
Thank you, you are right. Inside "if (value)" the !!value is always
1, so the set is BIT(offset). In v5 both branches use BIT(), here and
for ex_vals.
ft260_gpio_set() from patch 3 has the same two lines. v5 changes them
too, so the driver sets these bits in one way, as ft260_gpio_pin_set()
already does.
Thanks,
Michael