Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1935982pxk; Sat, 19 Sep 2020 07:06:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxqHpPG7QdHxiZKhHI1tDtvOvy/n+Ei4PbSuBjOc9dJLtEl3f2u25+s/Z6yuvwcKHDJMDq X-Received: by 2002:a50:fc91:: with SMTP id f17mr45496406edq.319.1600524369790; Sat, 19 Sep 2020 07:06:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600524369; cv=none; d=google.com; s=arc-20160816; b=nz8w2Ege0QEGxDTcBIqhO7AQVlN+BnOkf4IW2HNqeaQ4bwZhYP6PLeGfkXRBpWdyIX tTorDlXeOswIWz8hG+dvz2JkSNK/oEuKbE72cIFqbIjZDAvFJCD4FelJ3Kkb+UgoIV8T kpMILgom43vWwUt8DbP7X5raI8vMoShVJ34XNPY2eEtb8A7/Tv2iMTZvbSKweSpeauJW MOzzz7gG7uWxElvh5d8pxhRcOR51bMAB1xVhLVnd0e1Rw7ddFgljE7QTv04hFpte4+0p j/BsyTiS261wnQ6R7IwhAiWR1JWoQ1KdY8+oNrlk0mSEAGkP7xM6Q9+yWtMGRlgCdqqG bdPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature; bh=eW45fnDhv9Ny28DG/EFtyH1eqJUT2joYytD29glV+Y0=; b=IoGY06Wm3eHpBx/N6pZ6Jwfw5dZDDlyvprR8KrZEVf13WIYZ8TYb38Uns4PGheYGIY otDdmiRPF57gx9Isxb+jC6UcdxN44EWd1t1NbttgNugVog3fLbPgZIWszW2o3pcfuIpZ Ahn8FScK8EZF215jwXLeDBE6KuPLc8GCIAEHMXjGu4O41E8gRhmmIBHA0o2BFM231Njz x5F88KbO8wU6SMSN8DpU1QyIOZui39E1QbfzQej0TB/HSVB4H3A6GHRpIdgSDJTSyn7X paQ0sJEmwG7gyiRZgOM1jGSU1bk/+nwxlz+xX1y00THZipiDHsTSIrd2PTkGCawSwES4 28ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=H+vLyMxe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h19si4695582ejl.253.2020.09.19.07.05.46; Sat, 19 Sep 2020 07:06:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=H+vLyMxe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726537AbgISOEm (ORCPT + 99 others); Sat, 19 Sep 2020 10:04:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:41428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbgISOEi (ORCPT ); Sat, 19 Sep 2020 10:04:38 -0400 Received: from localhost.localdomain (unknown [194.230.155.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5376821D43; Sat, 19 Sep 2020 14:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600524278; bh=22njGzYbgVLmqZwKMutr7y/CtPsY/fcDoav/iUVMvtk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=H+vLyMxeyYECtqIstFTAEVcYMVxLLUGWmOnDIg4GXGuxFW1vJxBK098ltm2HfV7v+ nQ9BqSeEW4/Vsnns7z8JsXZyHJfY9q2EXB+FhB6V+oyQahkyUDfPFm1QZQJHntoAkH MeqNgQbLVvrXMjLeiVL5mFjgLL0x8/YQREYywY2s= From: Krzysztof Kozlowski To: Sebastian Reichel , Rob Herring , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Dan Murphy , Krzysztof Kozlowski , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/6] power: supply: bq27xxx: adjust whitespace and use BIT() for bitflags Date: Sat, 19 Sep 2020 16:04:15 +0200 Message-Id: <20200919140418.3705-4-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200919140418.3705-1-krzk@kernel.org> References: <20200919140418.3705-1-krzk@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org BIT() is a preferred way to toggle bit-like flags: no problems with 32/64 bit systems, less chances for mistakes. Remove also unneeded whitespace. Signed-off-by: Krzysztof Kozlowski --- drivers/power/supply/bq27xxx_battery.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c index 65806f668b1f..e971af43dd45 100644 --- a/drivers/power/supply/bq27xxx_battery.c +++ b/drivers/power/supply/bq27xxx_battery.c @@ -76,7 +76,7 @@ /* BQ27Z561 has different layout for Flags register */ #define BQ27Z561_FLAG_FDC BIT(4) /* Battery fully discharged */ -#define BQ27Z561_FLAG_FC BIT(5) /* Battery fully charged */ +#define BQ27Z561_FLAG_FC BIT(5) /* Battery fully charged */ #define BQ27Z561_FLAG_DIS_CH BIT(6) /* Battery is discharging */ /* control register params */ @@ -847,13 +847,14 @@ static struct bq27xxx_dm_reg bq27621_dm_regs[] = { #define bq27z561_dm_regs 0 #define bq28z610_dm_regs 0 - -#define BQ27XXX_O_ZERO 0x00000001 -#define BQ27XXX_O_OTDC 0x00000002 /* has OTC/OTD overtemperature flags */ -#define BQ27XXX_O_UTOT 0x00000004 /* has OT overtemperature flag */ -#define BQ27XXX_O_CFGUP 0x00000008 -#define BQ27XXX_O_RAM 0x00000010 -#define BQ27Z561_O_BITS 0x00000020 +#define bq34z100_dm_regs 0 + +#define BQ27XXX_O_ZERO BIT(0) +#define BQ27XXX_O_OTDC BIT(1) /* has OTC/OTD overtemperature flags */ +#define BQ27XXX_O_UTOT BIT(2) /* has OT overtemperature flag */ +#define BQ27XXX_O_CFGUP BIT(3) +#define BQ27XXX_O_RAM BIT(4) +#define BQ27Z561_O_BITS BIT(5) #define BQ27XXX_DATA(ref, key, opt) { \ .opts = (opt), \ -- 2.17.1