From patchwork Sat Jan 20 03:52:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 10176265 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C10876023A for ; Sat, 20 Jan 2018 04:15:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA88D20501 for ; Sat, 20 Jan 2018 04:15:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B995287C8; Sat, 20 Jan 2018 04:15:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=2.0 tests=BAYES_00, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D1E220501 for ; Sat, 20 Jan 2018 04:15:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754008AbeATEP2 (ORCPT ); Fri, 19 Jan 2018 23:15:28 -0500 Received: from gateway20.websitewelcome.com ([192.185.4.169]:42161 "EHLO gateway20.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753397AbeATEP2 (ORCPT ); Fri, 19 Jan 2018 23:15:28 -0500 X-Greylist: delayed 1396 seconds by postgrey-1.27 at vger.kernel.org; Fri, 19 Jan 2018 23:15:27 EST Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway20.websitewelcome.com (Postfix) with ESMTP id EEAC1401158C0 for ; Fri, 19 Jan 2018 21:52:10 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id ckCQeZPPYcGlpckCQeeHz4; Fri, 19 Jan 2018 21:52:10 -0600 Received: from [189.152.234.72] (port=49004 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.89_1) (envelope-from ) id 1eckCQ-000KGb-Kn; Fri, 19 Jan 2018 21:52:10 -0600 Date: Fri, 19 Jan 2018 21:52:09 -0600 From: "Gustavo A. R. Silva" To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] power: supply: da9030_battery: fix boolean value assignment in da9030_set_charge Message-ID: <20180120035209.GA15623@embeddedgus> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.152.234.72 X-Source-L: No X-Exim-ID: 1eckCQ-000KGb-Kn X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.152.234.72]:49004 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 8 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);