From: "Guido Günther" <agx@sigxcpu.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
USB <linux-usb@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] usb: typec: tps6598x: Export some power supply properties
Date: Tue, 1 Dec 2020 14:00:12 +0100 [thread overview]
Message-ID: <20201201130012.GA303449@bogon.m.sigxcpu.org> (raw)
In-Reply-To: <CAHp75VeLZtm85Y=3QMkPGb332wn05-zr-_mrrwXvnqLhazR1Gg@mail.gmail.com>
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@sigxcpu.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
>
prev parent reply other threads:[~2020-12-01 13:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-27 12:53 [PATCH v3 0/2] usb: typec: tps6598x: Export some power supply properties Guido Günther
2020-11-27 12:53 ` [PATCH v3 1/2] usb: typc: tps6598x: Select USB_ROLE_SWITCH and REGMAP_I2C Guido Günther
2020-11-30 10:27 ` Heikki Krogerus
2020-11-27 12:53 ` [PATCH v3 2/2] usb: typec: tps6598x: Export some power supply properties Guido Günther
2020-11-30 10:29 ` Heikki Krogerus
2020-11-30 18:35 ` Andy Shevchenko
2020-12-01 13:00 ` Guido Günther [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201201130012.GA303449@bogon.m.sigxcpu.org \
--to=agx@sigxcpu.org \
--cc=andy.shevchenko@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).