From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Sebastian Reichel <sre@kernel.org>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Subject: [PATCH] power: supply: da9030_battery: fix boolean value assignment in da9030_set_charge
Date: Fri, 19 Jan 2018 21:52:09 -0600 [thread overview]
Message-ID: <20180120035209.GA15623@embeddedgus> (raw)
Assign true or false to boolean variables instead of an integer value.
This issue was detected with the help of Coccinelle.
Fixes: 342d765e011f ("power_supply: Add Dialog DA9030 battery charger driver")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/power/supply/da9030_battery.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/da9030_battery.c b/drivers/power/supply/da9030_battery.c
index 5ca0f4d..2cc05bc 100644
--- a/drivers/power/supply/da9030_battery.c
+++ b/drivers/power/supply/da9030_battery.c
@@ -238,10 +238,10 @@ static void da9030_set_charge(struct da9030_charger *charger, int on)
val = DA9030_CHRG_CHARGER_ENABLE;
val |= (charger->charge_milliamp / 100) << 3;
val |= (charger->charge_millivolt - 4000) / 50;
- charger->is_on = 1;
+ charger->is_on = true;
} else {
val = 0;
- charger->is_on = 0;
+ charger->is_on = false;
}
da903x_write(charger->master, DA9030_CHARGE_CONTROL, val);
--
2.7.4
reply other threads:[~2018-01-20 3:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20180120035209.GA15623@embeddedgus \
--to=gustavo@embeddedor.com \
--cc=garsilva@embeddedor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--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).