From: "Pali Rohár" <pali.rohar@gmail.com>
To: Andrzej Hajda <a.hajda@samsung.com>
Cc: linux-kernel@vger.kernel.org,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Sebastian Reichel <sre@kernel.org>,
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
"open list:POWER SUPPLY CLASS/SUBSYSTEM and DRIVERS"
<linux-pm@vger.kernel.org>
Subject: Re: [PATCH] fix handling bq27xxx_read result
Date: Mon, 28 Sep 2015 10:57:05 +0200 [thread overview]
Message-ID: <201509281057.05307@pali> (raw)
In-Reply-To: <1443430287-575-1-git-send-email-a.hajda@samsung.com>
[-- Attachment #1: Type: Text/Plain, Size: 1075 bytes --]
On Monday 28 September 2015 10:51:27 Andrzej Hajda wrote:
> The function can return negative value.
>
> The problem has been detected using proposed semantic patch
> scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].
>
> [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
> drivers/power/bq27xxx_battery.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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) {
Seems legal change, so
Acked-By: Pali Rohár <pali.rohar@gmail.com>
--
Pali Rohár
pali.rohar@gmail.com
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2015-09-28 8:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-28 8:51 [PATCH] fix handling bq27xxx_read result Andrzej Hajda
2015-09-28 8:57 ` Pali Rohár [this message]
2015-09-28 16:34 ` 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=201509281057.05307@pali \
--to=pali.rohar@gmail.com \
--cc=a.hajda@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=dbaryshkov@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=m.szyprowski@samsung.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).