From: Dan Carpenter <error27@gmail.com>
To: Vincent Cloutier <vincent.cloutier@icloud.com>
Cc: Sebastian Reichel <sre@kernel.org>,
Hans de Goede <hansg@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>,
Purism Kernel Team <kernel@puri.sm>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 1/9] power: supply: max17042_battery: Put LSB units into defines
Date: Sat, 6 Jun 2026 19:12:29 +0300 [thread overview]
Message-ID: <aiRG7djdLTNoRyZr@stanley.mountain> (raw)
In-Reply-To: <20260406205759.493288-2-vincent.cloutier@icloud.com>
On Mon, Apr 06, 2026 at 04:57:49PM -0400, Vincent Cloutier wrote:
> From: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
>
> Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
> ---
> drivers/power/supply/max17042_battery.c | 36 ++++++++++++++-----------
> 1 file changed, 21 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c
> index acea176101fa..a6798b9a1c82 100644
> --- a/drivers/power/supply/max17042_battery.c
> +++ b/drivers/power/supply/max17042_battery.c
> @@ -52,6 +52,13 @@
>
> #define MAX17042_VMAX_TOLERANCE 50 /* 50 mV */
>
> +#define MAX17042_CURRENT_LSB 1562500ll /* 1.5625µV/Rsense */
> +#define MAX17042_CAPACITY_LSB 5000000ll /* 5.0µVH/Rsense */
> +#define MAX17042_TIME_LSB 5625 / 1000 /* s */
> +#define MAX17042_VOLTAGE_LSB 625 / 8 /* µV */
> +#define MAX17042_RESISTANCE_LSB 1 / 4096 /* Ω */
> +#define MAX17042_TEMPERATURE_LSB 1 / 256 /* °C */
Checkpatch complains about this:
ERROR: Macros with complex values should be enclosed in parentheses
But the macros rely on the fact that the parentheses are missing. You're
going to get one patch per year until the end of time which tries to add
the parentheses and eventually you will come to hate this bit of
cleverness.
regards,
dan carpenter
next prev parent reply other threads:[~2026-06-06 16:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-06 20:57 [PATCH v1 0/9] power: supply: max17042_battery: improve MAX17055 support Vincent Cloutier
2026-04-06 20:57 ` [PATCH v1 1/9] power: supply: max17042_battery: Put LSB units into defines Vincent Cloutier
2026-06-06 16:12 ` Dan Carpenter [this message]
2026-04-06 20:57 ` [PATCH v1 2/9] power: supply: max17042_battery: Use Current register in get_status Vincent Cloutier
2026-04-06 20:57 ` [PATCH v1 3/9] power: supply: max17042_battery: Use dev_err_probe for power supply registration Vincent Cloutier
2026-04-06 20:57 ` [PATCH v1 4/9] power: supply: max17042_battery: Route MAX17055 SOC alerts through dSOCi Vincent Cloutier
2026-04-06 20:57 ` [PATCH v1 5/9] power: supply: max17042_battery: Keep only critical alerts during suspend Vincent Cloutier
2026-04-06 20:57 ` [PATCH v1 6/9] power: supply: max17042_battery: Remove unused platform-data plumbing Vincent Cloutier
2026-04-06 20:57 ` [PATCH v1 7/9] power: supply: max17042_battery: use ModelCfg refresh on max17055 Vincent Cloutier
2026-04-06 20:57 ` [PATCH v1 8/9] power: supply: Read MAX17042 battery info before registration Vincent Cloutier
2026-06-04 16:37 ` Sebastian Reichel
2026-04-06 20:57 ` [PATCH v1 9/9] power: supply: max17042_battery: Treat MAX17055 VChg as explicit DT setting Vincent Cloutier
2026-06-04 16:39 ` [PATCH v1 0/9] power: supply: max17042_battery: improve MAX17055 support 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=aiRG7djdLTNoRyZr@stanley.mountain \
--to=error27@gmail.com \
--cc=hansg@kernel.org \
--cc=kernel@puri.sm \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=sebastian.krzyszkowiak@puri.sm \
--cc=sre@kernel.org \
--cc=vincent.cloutier@icloud.com \
/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