Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1316334yba; Tue, 2 Apr 2019 06:45:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjrC1TdlVpuWtqTil1El98kEZmrUCFgybdWnIAQJbE0UvzcLUSyiATpMhFvrQXTznAwOD0 X-Received: by 2002:a17:902:822:: with SMTP id 31mr27169052plk.290.1554212714059; Tue, 02 Apr 2019 06:45:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554212714; cv=none; d=google.com; s=arc-20160816; b=Pf7Rhy6cnEybY7NWhMYjlTXYlOUA+Nf7kBhZmpBYBjpKM+1CdxagHcgsmS41g5zgc7 hJ+X0CtbhcMQlHCR0O3FLdf1R2z7WtgLCU/3BjZTZQRkRDrVrMQ61iC/MxRU4s+XVQdv KVOC51mbJZqcXmI9AK7SfTrhiN0hNi6l6R8mX9NX0VhuLNOBQCwWByjRWaDSoPXDwQV6 9PFZVz4ZRaVrswn0T8GmFsBPhMdDc0Cr0MkmOedLjFXPVWt/oHbN8dDFI0xLX7gn5poJ 00W08ddUsvRVJR2frtMagBi8e3ZNYbg06fkstNDVTrr3qyijHW1EnUiK5WQY69Ub0WB3 WkLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=ZAW+tOPrvu0sgTmxzPFJngVer65IcaXIcTuwZhUUpYo=; b=T3B9K37oYJusmjUphzG/dDPkcQkc6AGWpYgnEplwxg8fUrhuW0BeX/2/wdd3xQVDsW uj+5NBOOxHOKfEvVvjgAhPiVwtL+B7isEewsXfnaEYhlvPKZGhhAsEQ3h55t1KsnJF7G FJ/F72IDtW5NiNbLLmMaoKUyVscOntQ23/NZpSN1eLcFU4TJwqufkIMwNnUscSIRinnF DgXKWjb+09ZCwJc+ynjpbET0WUq74aP64SGAK7s3KJf0mJs3oRYXXORwXWMvRsNDuJ06 sSS83tO3kIzp3rF5n2uHTfbRVAte7ChLuzEa0YtWnz9y3Se0RWQX6UCMtL39gcFhZnr0 MFAA== 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 k18si11540443pgb.351.2019.04.02.06.44.58; Tue, 02 Apr 2019 06:45:14 -0700 (PDT) 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 S1731530AbfDBNkL (ORCPT + 99 others); Tue, 2 Apr 2019 09:40:11 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:42818 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731151AbfDBNkB (ORCPT ); Tue, 2 Apr 2019 09:40:01 -0400 Received: from [167.98.27.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hBJdu-0002mc-7P; Tue, 02 Apr 2019 14:39:58 +0100 Received: from ben by deadeye with local (Exim 4.92) (envelope-from ) id 1hBJdt-0004rB-M8; Tue, 02 Apr 2019 14:39:57 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, Denis Kirjanov , "Lubomir Rintel" , "Sebastian Reichel" , "Pavel Machek" Date: Tue, 02 Apr 2019 14:38:27 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 10/99] power: supply: olpc_battery: correct the temperature units In-Reply-To: X-SA-Exim-Connect-IP: 167.98.27.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.65-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Lubomir Rintel commit ed54ffbe554f0902689fd6d1712bbacbacd11376 upstream. According to [1] and [2], the temperature values are in tenths of degree Celsius. Exposing the Celsius value makes the battery appear on fire: $ upower -i /org/freedesktop/UPower/devices/battery_olpc_battery ... temperature: 236.9 degrees C Tested on OLPC XO-1 and OLPC XO-1.75 laptops. [1] include/linux/power_supply.h [2] Documentation/power/power_supply_class.txt Fixes: fb972873a767 ("[BATTERY] One Laptop Per Child power/battery driver") Signed-off-by: Lubomir Rintel Acked-by: Pavel Machek Signed-off-by: Sebastian Reichel [bwh: Backported to 3.16: adjust filename] Signed-off-by: Ben Hutchings --- drivers/power/olpc_battery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/power/olpc_battery.c +++ b/drivers/power/olpc_battery.c @@ -425,14 +425,14 @@ static int olpc_bat_get_property(struct if (ret) return ret; - val->intval = (s16)be16_to_cpu(ec_word) * 100 / 256; + val->intval = (s16)be16_to_cpu(ec_word) * 10 / 256; break; case POWER_SUPPLY_PROP_TEMP_AMBIENT: ret = olpc_ec_cmd(EC_AMB_TEMP, NULL, 0, (void *)&ec_word, 2); if (ret) return ret; - val->intval = (int)be16_to_cpu(ec_word) * 100 / 256; + val->intval = (int)be16_to_cpu(ec_word) * 10 / 256; break; case POWER_SUPPLY_PROP_CHARGE_COUNTER: ret = olpc_ec_cmd(EC_BAT_ACR, NULL, 0, (void *)&ec_word, 2);