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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VeLZtm85Y=3QMkPGb332wn05-zr-_mrrwXvnqLhazR1Gg@mail.gmail.com>
Date:   Mon, 30 Nov 2020 20:35:26 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Guido Günther <agx@...xcpu.org>
Cc:     Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        USB <linux-usb@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 2/2] usb: typec: tps6598x: Export some power supply properties

On Fri, Nov 27, 2020 at 2:57 PM Guido Günther <agx@...xcpu.org> wrote:
>
> This allows downstream supplies and userspace to detect
> whether external power is supplied.

> +       if (!(pwr_status & TPS_POWER_STATUS_CONNECTION) ||
> +           !(pwr_status & TPS_POWER_STATUS_SOURCESINK)) {
> +               val->intval = 0;
> +       } else {
> +               val->intval = 1;
> +       }

Can we please use positive conditionals (which usually are easier to read)?

       if ((pwr_status & TPS_POWER_STATUS_CONNECTION) &&
           (pwr_status & TPS_POWER_STATUS_SOURCESINK)) {
               val->intval = 1;
       } else {
               val->intval = 0;
       }

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ