lkml.org 
[lkml]   [2018]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6] USB: serial: ftdi_sio: implement GPIO support for FT-X devices
>> + if (priv->gpio_output & BIT(gpio))
>> + return 0;
>> + else
>> + return 1;
>>
>> This could just simplified using negation (!), but perhaps this is
>> easier to parse as it stands.
>>
>> Sorry, it is not clear what your preferred action here is.
>> So should I leave it as is then or not?
>
> Just do
>
> res = !(priv->gpio_output & BIT(gpio));
>

Locking here? priv->gpio_output is a u8, there is no way it can be partially
written. Or am I missing something else?

Karoly

\
 
 \ /
  Last update: 2018-09-25 13:11    [W:1.989 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site