Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3878846imu; Mon, 7 Jan 2019 11:07:19 -0800 (PST) X-Google-Smtp-Source: ALg8bN4wJ0SNHMRj1O+jQp+G+PrSdoNQv65fNRz+zCnunqZMIy2P63gqvqHY/uGY7UBJPF7cJuen X-Received: by 2002:a17:902:3181:: with SMTP id x1mr21112686plb.58.1546888039496; Mon, 07 Jan 2019 11:07:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546888039; cv=none; d=google.com; s=arc-20160816; b=EvIKZ6uEE/AKQz9iQMyYbcT86au7vos636mCb3lZj4engR8IDev0JqzTgsuR2aO4O4 zF8pgKQZxGPpIiMSZK330/jDOJQXRzIwFAS1asGs/4aWHa8CA2gB2HazcDvlzmcmNeYF EEhKPgUP3bsBwlkCBf8eZExyJWqBuVSoQJSG5MT9yBF+BWQOUVGBK17umFpFZXLvGHb4 L7SR42BI6xvA4InME1NjEHfrkSMkEQuI1ggE5yiCxcKCOYEJj0qoaZzRHUmy3BYUr7US vUkPId76Jf8f37491LSgxOCSOj1AtxRDt8f1tNifadVHt/5h0fYtJzYXb764MdLjpVbk nZhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date; bh=Jn480CTyAujpruoy0WFdkLzf+sb1AViOdCanev5T43U=; b=crzqNY/v0Z9DvnJ9tTTo6mYaCxWgeN+Tm4gAOGZEcbTLnu59VQY5Na5B3Rffwn0WqO sIo/PTPoMdWWtRkKCeJzD7shHDgftJQXW28AGR7DpyH4hUWaWlPiWEBEIXu4zNwNT1Kf YN5e5nNjwmNI+NwJphPG8rc/0mQ7vGJmceOUHaeLqPoMr7hEX3fPXW0eSlAObrDjT1pT UBrzpy6IDRjfxRB9O7VtfuwnKmr8VM9rGxtAuHmqVC/YW8Aht3svvBmfhutxdEHeRDSw rv7OQ5vZJOgRdF8cJfJc278CcUki3grbirA8Li9sySC2/MY2Y7TUcR5+FpjoEVfEftzh HROg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b19si18338023pfm.100.2019.01.07.11.07.03; Mon, 07 Jan 2019 11:07:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727153AbfAGTF5 (ORCPT + 99 others); Mon, 7 Jan 2019 14:05:57 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:49670 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726392AbfAGTF5 (ORCPT ); Mon, 7 Jan 2019 14:05:57 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 9E15A809DB; Mon, 7 Jan 2019 20:05:50 +0100 (CET) Date: Mon, 7 Jan 2019 20:05:55 +0100 From: Pavel Machek To: kernel list , baolin.wang@linaro.org, linus.walleij@linaro.org, sebastian.reichel@collabora.com Subject: 5.0-rc1 Open circuit voltage tables -- 3afb50d7125bc Message-ID: <20190107190555.GA18865@amd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Qxx1br4bt0+wmkIi" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! Can we do something with that code? First -- tables should not be necceessary. Formula for li-ion open circuit voltage is well-known, and does not really depend on the device -- only on the chemistry of battery. state of charge =3D f( voltage, current, internal resistance ) (And yes, internal resistance depends on temperature and health of the battery). Second, even if we need tables, why is it doing multiple allocations? info->ocv_temp[index] =3D -EINVAL; That's just wrong. Ocv_temp is temperature in celsius. Temperatures go below zero. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --Qxx1br4bt0+wmkIi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlwzoxMACgkQMOfwapXb+vJWQwCffZliqg1CauJhr5G2AxH2XCZE tUcAmQG/7RJ2xRgNIaKRERNwltVJnhHT =Tkwq -----END PGP SIGNATURE----- --Qxx1br4bt0+wmkIi--