[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200501134808.dbmsc7sy7pffiqvr@earth.universe>
Date: Fri, 1 May 2020 15:48:08 +0200
From: Sebastian Reichel <sebastian.reichel@...labora.com>
To: Michał Mirosław <mirq-linux@...e.qmqm.pl>
Cc: Andrey Smirnov <andrew.smirnov@...il.com>,
Guenter Roeck <linux@...ck-us.net>,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH v3 02/11] power: charger-manager: don't write through
desc->properties
Hi,
On Fri, May 01, 2020 at 03:30:08PM +0200, Michał Mirosław wrote:
> On Fri, May 01, 2020 at 02:38:49PM +0200, Sebastian Reichel wrote:
> > Hi,
> >
> > On Fri, Apr 03, 2020 at 10:20:31PM +0200, Michał Mirosław wrote:
> > > psy_desc->properties will become pointer to const. Avoid writing
> > > through the pointer to enable constification of the tables elsewhere.
> > >
> > > Signed-off-by: Michał Mirosław <mirq-linux@...e.qmqm.pl>
> > For patches 1-3 I used my version, that I wrote in parallel while
> > reviewing a different patch series. It is slightly different, but
> > achieves the same goal.
>
> There is a bug in the tree now regarding use of num_properties
> in charger-manager. Following patch should fix it.
Thanks, I folded this into the charger-manager patch.
-- Sebastian
> Best Regards,
> Michał Mirosław
>
> diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
> index a71e2ee81423..2ef53dc1f2fb 100644
> --- a/drivers/power/supply/charger-manager.c
> +++ b/drivers/power/supply/charger-manager.c
> @@ -1740,14 +1740,14 @@ static int charger_manager_probe(struct platform_device *pdev)
> }
> if (!power_supply_get_property(fuel_gauge,
> POWER_SUPPLY_PROP_CHARGE_NOW, &val)) {
> - properties[cm->charger_psy_desc.num_properties] =
> + properties[num_properties] =
> POWER_SUPPLY_PROP_CHARGE_NOW;
> num_properties++;
> }
> if (!power_supply_get_property(fuel_gauge,
> POWER_SUPPLY_PROP_CURRENT_NOW,
> &val)) {
> - properties[cm->charger_psy_desc.num_properties] =
> + properties[num_properties] =
> POWER_SUPPLY_PROP_CURRENT_NOW;
> num_properties++;
> }
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists