From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91A3EC47253 for ; Fri, 1 May 2020 13:48:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C23320757 for ; Fri, 1 May 2020 13:48:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731947AbgEANsS (ORCPT ); Fri, 1 May 2020 09:48:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1731925AbgEANsO (ORCPT ); Fri, 1 May 2020 09:48:14 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00E47C08E859; Fri, 1 May 2020 06:48:13 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 3703E2A3057 Received: by earth.universe (Postfix, from userid 1000) id C13453C08C7; Fri, 1 May 2020 15:48:08 +0200 (CEST) Date: Fri, 1 May 2020 15:48:08 +0200 From: Sebastian Reichel To: =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: Andrey Smirnov , Guenter Roeck , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v3 02/11] power: charger-manager: don't write through desc->properties Message-ID: <20200501134808.dbmsc7sy7pffiqvr@earth.universe> References: <20200501123849.ws2a5ybeeej6phyr@earth.universe> <20200501133008.GA8927@qmqm.qmqm.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="knuoulvhycxt3vyk" Content-Disposition: inline In-Reply-To: <20200501133008.GA8927@qmqm.qmqm.pl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --knuoulvhycxt3vyk Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Fri, May 01, 2020 at 03:30:08PM +0200, Micha=C5=82 Miros=C5=82aw wrote: > On Fri, May 01, 2020 at 02:38:49PM +0200, Sebastian Reichel wrote: > > Hi, > >=20 > > On Fri, Apr 03, 2020 at 10:20:31PM +0200, Micha=C5=82 Miros=C5=82aw wro= te: > > > psy_desc->properties will become pointer to const. Avoid writing > > > through the pointer to enable constification of the tables elsewhere. > > >=20 > > > Signed-off-by: Micha=C5=82 Miros=C5=82aw > > 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. >=20 > 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=C5=82 Miros=C5=82aw >=20 > diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/suppl= y/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] =3D > + properties[num_properties] =3D > 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] =3D > + properties[num_properties] =3D > POWER_SUPPLY_PROP_CURRENT_NOW; > num_properties++; > } --knuoulvhycxt3vyk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAl6sKIwACgkQ2O7X88g7 +pprmA//a2gYLZogVty4flbheMGa30mYF3mxI3KM495HeF2OrPAN2fN9zZXsPQwC hgwuhIqpsTHzjFIvFzQ1RsAJjVTrGsvwBUd875zxqf0z4FO++UYRhdZmpxC6rFCI cTaAgyRrnuQjlBHHZTfzbcOQlM4W6hskLOaOR7NFSIoAn7KvrBCc/tRHUcY9f4JY aOKi34jSGG8WcnIPIDBgcFRuL66Xzh7qbKkYK5j1Q7VbXxps6YXYeDyqI7Nx6R2r W2K1Elo2eIrXTXb5Z2CV2xP0lFkcAYTn+B7i4IiKU6hL6ctH0d1hbUVM6OOxDGHR ThEOKHmHBgcrvXDZ+J40s4QddmIUgCDs5wzBIm2qbNKohnYOpTusn6M2Psld1Ae/ n8vNAaWFhArjD0NSNN9UrmGQE+BV0Eu3RpC8YQ33C4TAy9zT6g964Bs9Zty57iaa hHjlMCHrAEIRoNGiloElrCA1BKV9DnhkL4nqt0XeCh3PUJ2W/OAgv3hXg0YMWJM8 ha2E9Jmgqyi2C8hphFSjP5bDMtQQx2yEugn0lqcaREdgdeaOCaslmUYd1BQ4uZbA l/mBn1qz2Thv3iO/ZGK9GT7Z+jqkZAZI0fTUswhl2Ag1n3UPTJgwPpbWzO/40Qbw 0WjrCnetZxodJT/UXg0L2roQrgh0Mh0IR5Cs3V0wTeQJWi5OoTI= =GnxU -----END PGP SIGNATURE----- --knuoulvhycxt3vyk--