Messages in this thread |  | | Date | Fri, 1 May 2020 15:48:08 +0200 | From | Sebastian Reichel <> | 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@rere.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++; > } [unhandled content-type:application/pgp-signature] |  |