lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6fdea2db02ece8c7b51fb03a112fa4c0@pados.hu>
Date:   Tue, 25 Sep 2018 11:11:03 +0000
From:   "Karoly Pados" <pados@...os.hu>
To:     "Johan Hovold" <johan@...nel.org>
Cc:     "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        "Loic Poulain" <loic.poulain@...aro.org>
Subject: Re: [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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ