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

From
Michael Zaidman <michael.zaidman@gmail.com>
Date
2026-11-18 16:40:14
Also in
linux-gpio, linux-i2c, linux-serial, lkml
Reply to
Maarten Brock, 2026-11-17
On Tue, Nov 17, 2026 at 11:56:36PM +0000, Maarten Brock wrote:
quoted
+		if (value)
+			gpio->vals |= !!value << offset;
Odd choice of asymmetry: !!value == true, then converted to int and shifted up.
quoted
+		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
Thread (27 messages) 27 messages, 4 authors, last reply 1d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help