[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201201130012.GA303449@bogon.m.sigxcpu.org>
Date: Tue, 1 Dec 2020 14:00:12 +0100
From: Guido Günther <agx@...xcpu.org>
To: Andy Shevchenko <andy.shevchenko@...il.com>
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
Hi,
On Mon, Nov 30, 2020 at 08:35:26PM +0200, Andy Shevchenko wrote:
> 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)?
Make sense. Fixed in v4.
-- Guido
>
> 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