From: Dan Carpenter <dan.carpenter@oracle.com>
To: "Pali Rohár" <pali.rohar@gmail.com>, "Andrew F. Davis" <afd@ti.com>
Cc: Sebastian Reichel <sre@kernel.org>,
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] power: bq27xxx_battery: signedness bug in bq27xxx_battery_read_health()
Date: Mon, 28 Sep 2015 12:16:53 +0300 [thread overview]
Message-ID: <20150928091653.GA11367@mwanda> (raw)
We need flags to be signed for the error handling to work.
Fixes: 74aab849f342 ('power: bq27xxx_battery: Cleanup health checking')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/power/bq27xxx_battery.c b/drivers/power/bq27xxx_battery.c
index 473aa2f..994c78d 100644
--- a/drivers/power/bq27xxx_battery.c
+++ b/drivers/power/bq27xxx_battery.c
@@ -691,7 +691,7 @@ static bool bq27xxx_battery_dead(struct bq27xxx_device_info *di, u16 flags)
*/
static int bq27xxx_battery_read_health(struct bq27xxx_device_info *di)
{
- u16 flags;
+ int flags;
flags = bq27xxx_read(di, BQ27XXX_REG_FLAGS, false);
if (flags < 0) {
next reply other threads:[~2015-09-28 9:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-28 9:16 Dan Carpenter [this message]
2015-09-28 15:08 ` [patch] power: bq27xxx_battery: signedness bug in bq27xxx_battery_read_health() Andrew F. Davis
2015-09-28 16:33 ` Sebastian Reichel
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=20150928091653.GA11367@mwanda \
--to=dan.carpenter@oracle.com \
--cc=afd@ti.com \
--cc=dbaryshkov@gmail.com \
--cc=dwmw2@infradead.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pali.rohar@gmail.com \
--cc=sre@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).