Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp647660imu; Fri, 11 Jan 2019 06:46:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN5JjxqnMuzCNyZvj+z0VAQ1/L+I8atAmwmpENK5UxBLZEZwrJkBmH+8p+qrjVkNHpz04+fL X-Received: by 2002:a17:902:8ec9:: with SMTP id x9mr15049728plo.27.1547217963211; Fri, 11 Jan 2019 06:46:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547217963; cv=none; d=google.com; s=arc-20160816; b=MMMGttTLv5D/gl1se/1gWvKhwPsOeHCV5Ckat/ZSu/Y45wezwQqQuMAqGgvPJ6FdNs pUc7KLZp+iz3SZDjgF9E4dtSbabjt0gYEa8xCKT1MjoqGIro0pKnNf8LS9+Oa7yJNM0i 2ULZm1V4NuXwlWhhWoHEJt5wWUwyqrwOAREbkUtn3bP2j/5zzhYPpTgyW3LosGk+bqHJ 1rXNvNcPM/x22PZkYD+wYv6ZQbKp0TI4DO/vn+H2Z+tQr9YTi9xxAZaYT7HGmn76xiUP eoDPeO73VC3mJmSXHg1nMuU5S5J6+HMUDWBesPlELquJiTQALD0mN3DF5jV50qgaiVCi f+yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DxXo6qItSHVHsv4XKuqkqnot632RcbvrLshyha9x+yE=; b=mM6vxwgFrjvDiIbOEzvQlw25uyoxkBb48zxZeY6GxHEu5v8HSTxNofXO4v52AYmpPl jp7XeBipo9akjAfWXQefUzp8IqGUn1FxOeX2tPEv6NDPX9vw1fr2qn/5KVrHJ8q38UfU o4R1ydz0wXdXSDVwyJv5uB07g+elaf5bHDC/b/CF3+3k7kZ9pHmt9HHBAGq435XQbhnW 6B2Uhrum7L5hL0P5XjAtoiNRGvmdaiE67pJWbjAfISP/+/kGS1HpY97ni309b9lBhpqY tAu0iJvT+mNkGNB4umgT13i7yYa4xbrTHjOKofD6OAhQKcjGMIMwv290JtfztM6Rbavq AWmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0tqdbLcY; 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 d10si1622695pgf.136.2019.01.11.06.45.47; Fri, 11 Jan 2019 06:46:03 -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; dkim=pass header.i=@kernel.org header.s=default header.b=0tqdbLcY; 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 S2404075AbfAKOn7 (ORCPT + 99 others); Fri, 11 Jan 2019 09:43:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:36900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404511AbfAKOn5 (ORCPT ); Fri, 11 Jan 2019 09:43:57 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6E5B02063F; Fri, 11 Jan 2019 14:43:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547217836; bh=WLmvW3qN7xdyUvKG5WICrpKzdk6yTactIH1S9rStr2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0tqdbLcYudS/Nbe3/wdVojseuDLSK+rxUVDxPgesp2S8C5mbVTtGf1tYn26Ew7Qdl 0EkNXfChdkLsvQjNS3sfeu4VrkKLqWnU2rj9/FGX+drcAlNJT3OG/D2gGtFnjohqdR 2QGrlpVGFW+7mSqrLudNTjT+909T8RYBk37erd4s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lubomir Rintel , Pavel Machek , Sebastian Reichel Subject: [PATCH 4.20 59/65] power: supply: olpc_battery: correct the temperature units Date: Fri, 11 Jan 2019 15:15:45 +0100 Message-Id: <20190111131104.003405397@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111131055.331350141@linuxfoundation.org> References: <20190111131055.331350141@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable 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") Cc: stable@vger.kernel.org Signed-off-by: Lubomir Rintel Acked-by: Pavel Machek Signed-off-by: Sebastian Reichel Signed-off-by: Greg Kroah-Hartman --- drivers/power/supply/olpc_battery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/power/supply/olpc_battery.c +++ b/drivers/power/supply/olpc_battery.c @@ -428,14 +428,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);