All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: linus.walleij@linaro.org
Cc: linux-pm@vger.kernel.org
Subject: [bug report] power: supply: generic-adc-battery: Use GPIO descriptors
Date: Fri, 4 Dec 2020 17:51:44 +0300	[thread overview]
Message-ID: <X8pNAJq2LdPJ29w9@mwanda> (raw)

Hello Linus Walleij,

The patch b0327ffb133f: "power: supply: generic-adc-battery: Use GPIO
descriptors" from Oct 30, 2020, leads to the following static checker
warning:

	drivers/power/supply/generic-adc-battery.c:97 gab_charge_finished()
	warn: signedness bug returning '(-4095)'

drivers/power/supply/generic-adc-battery.c
    93  static bool gab_charge_finished(struct gab *adc_bat)
    94  {
    95          if (!adc_bat->charge_finished)
    96                  return false;
    97          return gpiod_get_value(adc_bat->charge_finished);

The gpiod_get_value() can return negative error codes so it's not
necessarily clear if that should translate to a true as it does now or
to a false...

    98  }

regards,
dan carpenter

             reply	other threads:[~2020-12-04 14:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04 14:51 Dan Carpenter [this message]
2020-12-09 10:00 ` [bug report] power: supply: generic-adc-battery: Use GPIO descriptors Linus Walleij

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=X8pNAJq2LdPJ29w9@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-pm@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.