All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Matti Vaittinen <mazziesaccount@gmail.com>
Cc: Sebastian Reichel <sre@kernel.org>,
	Marcus Cooper <codekipper@gmail.com>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH 2/2] power: supply: ab8500: Exit maintenance if too low voltage
Date: Thu, 5 May 2022 22:22:55 +0200	[thread overview]
Message-ID: <CACRpkdbfuEJCSnC0XmUZtz8zGfFmHFBCSdc10CGhjDPbSvVJFA@mail.gmail.com> (raw)
In-Reply-To: <36001b47-99fc-1b49-49e7-018f81b717c4@gmail.com>

On Tue, Apr 19, 2022 at 11:26 AM Matti Vaittinen
<mazziesaccount@gmail.com> wrote:

> Probably just a matter of taste (like underscores in private function
> names ;] ) - I would prefer combining the cases for INITs to something like:
>
>         case STATE_MAINTENANCE_A_INIT:
>         case STATE_MAINTENANCE_B_INIT:
>
>                 mt = power_supply_get_maintenance_charging_setting(bi,
>                         (di->charge_state == STATE_MAINTENANCE_B_INIT));
>
> ...
>                 ab8500_chargalg_state_to(di, di->charge_state + 1);
>
>         break;
>
> That would slightly reduce the code although at the cost of additional
> arithmetics. I'm leaving this to you though.

Yeah there is something like a firehose of stuff here when it comes
to coding style in this charging driver, and on top of that it
"would be nice" if the kernel had some state machine primitives one
could use in order to centralize such code and make it more robust...

> FWIW: After someone telling me that I should not worry about the cold
> weather (ref. my comment for the patch 1/2)
>
> Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>

Thanks, are you pleased with my answer to 1/2?

Yours,
Linus Walleij

  parent reply	other threads:[~2022-05-05 20:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15 20:36 [PATCH 1/2] power: supply: ab8500: Respect charge_restart_voltage_uv Linus Walleij
2022-04-15 20:36 ` [PATCH 2/2] power: supply: ab8500: Exit maintenance if too low voltage Linus Walleij
2022-04-19  9:26   ` Matti Vaittinen
2022-04-19  9:44     ` Matti Vaittinen
2022-05-05 20:22     ` Linus Walleij [this message]
2022-04-19  8:50 ` [PATCH 1/2] power: supply: ab8500: Respect charge_restart_voltage_uv Vaittinen, Matti
2022-05-05 20:17   ` Linus Walleij
2022-05-06  5:38     ` Vaittinen, Matti
2022-05-09 10:33       ` Linus Walleij
2022-05-09 13:27         ` Vaittinen, Matti
2022-05-20 21:36 ` Linus Walleij
2022-06-09 20:12   ` 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=CACRpkdbfuEJCSnC0XmUZtz8zGfFmHFBCSdc10CGhjDPbSvVJFA@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=codekipper@gmail.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=mazziesaccount@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.