public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] power: supply: generic-adc-battery: Use GPIO descriptors
@ 2020-12-04 14:51 Dan Carpenter
  2020-12-09 10:00 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-12-04 14:51 UTC (permalink / raw)
  To: linus.walleij; +Cc: linux-pm

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-09 10:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-04 14:51 [bug report] power: supply: generic-adc-battery: Use GPIO descriptors Dan Carpenter
2020-12-09 10:00 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox