Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1785148ybc; Sun, 24 Nov 2019 06:10:57 -0800 (PST) X-Google-Smtp-Source: APXvYqw4FHGqetXoV7zfiw+KLUEO5S2mOlE40HoqoYu7RUttcGKAikNAexPool7Jxmcx7IBUXk0Z X-Received: by 2002:a17:906:c353:: with SMTP id ci19mr30295120ejb.249.1574604657374; Sun, 24 Nov 2019 06:10:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574604657; cv=none; d=google.com; s=arc-20160816; b=TIVLoUvJ6iNtVKOUSypTeQ5BEWBrXhaIvjLiObnd7WYXXmy2TuKhCr1sRNtYqWgXf2 UwWzpXzVM0HSxYjtRLSUs7hhecbVi3VercmZs5R3N/nTjtrPo1ABa2UZTyi4DN+SnXfV 1Lyp5hrUIXq4M+zWwHuO8sdw9ExCmV/l3LCz3fS9POnJYM9/vImVYgNd6hgkpko8s7Lm xP597H2uVYWpptULdefQF3DzpAI1wDtjU9LE4+jXyN1LidwC+apzNBRndSP7F9f+jFvS tE3fn7joRM3sx8oXqfKUuU2XAoauU0ObRtleRSwr4y/fnog/Uu6+TxLJCX7pTvAu0VqC MVbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=czC6nSQ5Mc9CJVDHU8aRwsMtho/ZtmD5fWxjP8fTWFQ=; b=BrT9h27yww60bWgBEkGlqiagNfzMU4zBwTCRMgijLq4MhpKEUgQoUujRoF2aGTFt4U BwBysVZDsodPv485fYvP+n+WjdEl+zjiw08NinDRngEWDw/1DV/G403yCqH0vRpSTTpH iF+mFRNxCMPiPISXRiKn7fC+WR/l+NZqR43sdNI5tsx+LL9wfsuIA7ClClAKkz/5QovR znZRBrr3QtxrmRnasDp/QEVFOT4ScoB5Qri+CMvgyM0I0BTIsP6PLbjNMpgj6spnOeOU pQhWlayVPN44fcIQr0M6gaHlPOqtvmQJDqUgjQ+TdLgsoKnvLnYekUSf3p4PV6cS669b cLNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="GtT9zO/t"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e25si2930766edr.117.2019.11.24.06.10.33; Sun, 24 Nov 2019 06:10:57 -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=@gmail.com header.s=20161025 header.b="GtT9zO/t"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727149AbfKXOJV (ORCPT + 99 others); Sun, 24 Nov 2019 09:09:21 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:41146 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726767AbfKXOJT (ORCPT ); Sun, 24 Nov 2019 09:09:19 -0500 Received: by mail-pf1-f195.google.com with SMTP id p26so5961006pfq.8; Sun, 24 Nov 2019 06:09:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=czC6nSQ5Mc9CJVDHU8aRwsMtho/ZtmD5fWxjP8fTWFQ=; b=GtT9zO/ttEp5EBxeDarWq2F13mveIYiDxKZ+MRPLPaXmXvU0VbpaI+P7v8Y3ikAyBS TFvreqga/+8htA8ez08lE8xi7POJ9OOpHQ6t6Jcn8oVr+EFKYcfbyS8pp5zB/c0A1Jk9 lvvfUmieleCnquwCneIlKLcCcROA4HGk40h21iUwvZFb00MvAfbxehG4CrGcVENsG7Wq IHWqhzhWmc8k2RT129cEMiNI2xhfxyrP7GzYg3wc5mifpsg+NSpVVZQ8tPFwKBuIveQx amy6ltiZRgfG1VR6PJy6KcADSBkSsUpyDhLEtFAZ2b/EaDg69FUZIXIGyCM5/FZmdN/g hhtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=czC6nSQ5Mc9CJVDHU8aRwsMtho/ZtmD5fWxjP8fTWFQ=; b=mKmab9yq65CL4lCoDxbBgRg0nf5yB1axP53lvgwyzuzHKKNHgkB9lnnHDo+uDVYoM5 e7BVgQJbevDNA5yV6rKtK8xZGC82uEYz1TicgL1QNE11PWcR4wl73DjLCkj2aiDuXBtT +Wx4zzbERHOHc0O+Sbjd+jGlH572uCXysV3p1NsZYUjGdFmFhS6/zKfnrUfk9tKbHbEU S3g9tcwNCnjmE2qZfUUIFlsBgFE6Bfluo5PGNJcJe3liPWGgWoc/k5dNEvR25KXq4Rhn u7FB3cZf7Gla9zqtvw440WtBRZlLSI4uN/cWpT9qlqxnup6IJisNYtQTZmtcyiLBbd/d dsPw== X-Gm-Message-State: APjAAAV7yNkkMJLy9seb0jJRm4elwPJOAV0M4I8ydjGbrS9QNOrBGkmS VGnSCVHceuGm+NC7creJna1qemaVHYI= X-Received: by 2002:a63:1718:: with SMTP id x24mr24924884pgl.1.1574604558045; Sun, 24 Nov 2019 06:09:18 -0800 (PST) Received: from localhost.localdomain ([240f:34:212d:1:368e:e048:68f1:84e7]) by smtp.gmail.com with ESMTPSA id a3sm4816326pgh.91.2019.11.24.06.09.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 24 Nov 2019 06:09:17 -0800 (PST) From: Akinobu Mita To: linux-nvme@lists.infradead.org, linux-hwmon@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Akinobu Mita , Sujith Thomas , Darren Hart , Andy Shevchenko , Zhang Rui , Eduardo Valentin , Daniel Lezcano , Amit Kucheria , Jean Delvare , Guenter Roeck , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg Subject: [PATCH 2/8] ACPI: thermal: switch to use helpers Date: Sun, 24 Nov 2019 23:08:44 +0900 Message-Id: <1574604530-9024-3-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1574604530-9024-1-git-send-email-akinobu.mita@gmail.com> References: <1574604530-9024-1-git-send-email-akinobu.mita@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This switches the ACPI thermal zone driver to use celsius_to_deci_kelvin() and deci_kelvin_to_celsius() in instead of helpers in . This is preparation for centralizing the kelvin to/from Celsius conversion helpers in . Cc: Sujith Thomas Cc: Darren Hart Cc: Andy Shevchenko Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Amit Kucheria Cc: Jean Delvare Cc: Guenter Roeck Cc: Keith Busch Cc: Jens Axboe Cc: Christoph Hellwig Cc: Sagi Grimberg Signed-off-by: Akinobu Mita --- drivers/acpi/thermal.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index d831a61..bd9b6eb 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -297,7 +297,9 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) if (crt == -1) { tz->trips.critical.flags.valid = 0; } else if (crt > 0) { - unsigned long crt_k = CELSIUS_TO_DECI_KELVIN(crt); + unsigned long crt_k = + celsius_to_deci_kelvin(crt); + /* * Allow override critical threshold */ @@ -333,7 +335,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) if (psv == -1) { status = AE_SUPPORT; } else if (psv > 0) { - tmp = CELSIUS_TO_DECI_KELVIN(psv); + tmp = celsius_to_deci_kelvin(psv); status = AE_OK; } else { status = acpi_evaluate_integer(tz->device->handle, @@ -413,7 +415,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) break; if (i == 1) tz->trips.active[0].temperature = - CELSIUS_TO_DECI_KELVIN(act); + celsius_to_deci_kelvin(act); else /* * Don't allow override higher than @@ -421,9 +423,9 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) */ tz->trips.active[i - 1].temperature = (tz->trips.active[i - 2].temperature < - CELSIUS_TO_DECI_KELVIN(act) ? + celsius_to_deci_kelvin(act) ? tz->trips.active[i - 2].temperature : - CELSIUS_TO_DECI_KELVIN(act)); + celsius_to_deci_kelvin(act)); break; } else { tz->trips.active[i].temperature = tmp; @@ -1087,7 +1089,8 @@ static int acpi_thermal_add(struct acpi_device *device) INIT_WORK(&tz->thermal_check_work, acpi_thermal_check_fn); pr_info(PREFIX "%s [%s] (%ld C)\n", acpi_device_name(device), - acpi_device_bid(device), DECI_KELVIN_TO_CELSIUS(tz->temperature)); + acpi_device_bid(device), + deci_kelvin_to_celsius(tz->temperature)); goto end; free_memory: -- 2.7.4