RE: [PATCH v4 08/16] HID: ft260: uart: add modem pins control via ioctl

From: Maarten Brock

Date: Tue Nov 17 2026 - 18:56:56 EST


> -----Original Message-----
> From: Michael Zaidman <michael.zaidman@xxxxxxxxx>
> +static void ft260_gpio_output_cfg(struct ft260_gpio_state *gpio,
> + u32 offset, int value)
> +{
> + if (offset < FT260_GPIO_0_5_COUNT) {
> + gpio->dirs |= BIT(offset);
> + 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().

> + } else {
> + offset = offset - FT260_GPIO_0_5_COUNT;
> + gpio->ex_dirs |= BIT(offset);
> + if (value)
> + gpio->ex_vals |= !!value << offset;

Idem.

> + else
> + gpio->ex_vals &= ~BIT(offset);
> + }
> }

Kind regards,
Maarten