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=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 A9BCEC432C3 for ; Sun, 24 Nov 2019 14:09:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 835B8207FD for ; Sun, 24 Nov 2019 14:09:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aF+EL/ua" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727267AbfKXOJu (ORCPT ); Sun, 24 Nov 2019 09:09:50 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:44826 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726767AbfKXOJu (ORCPT ); Sun, 24 Nov 2019 09:09:50 -0500 Received: by mail-pg1-f195.google.com with SMTP id e6so5745617pgi.11; Sun, 24 Nov 2019 06:09:49 -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=HlZyESYLe6A5DAq1XkhuEkfPsYgeQ0ev4dh7nFf6DlA=; b=aF+EL/uaBuy3BwpoI2oa5LtqP9+p1sZ6VjixxtI6M70GSLCINBULaM3WNiSvJ1WIrZ xIp52aIi0nJQeAktwdoDbbpWpUGRijeoTLe1MAm4hB4Z4WYl9NAkew4iN56rugjskot4 yt0PkQGxQXJReAVRmTDpxgmvwAEprEGHPYHel8zMm9c4Pbf0nfdxKiEAsstWT0AfLR8r bDsPU9XMtHOa1IO5HUXITzT66ktxxcPF+Z9kAYhRpX5dnnkPp6PRQV0tZTGgJfpG2Hcz Q8Q4/16zkCk9xffjh+a8YQwbn/z/50qSQu4mMZdfby+ch8XiXZOg7GCvCrNQfdl2VLIo mnVQ== 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=HlZyESYLe6A5DAq1XkhuEkfPsYgeQ0ev4dh7nFf6DlA=; b=iV6zmf0RUu6hsg8v6w0y/b39yhmMlbUsKsvq4E9CQKrm0hRM9iNB2f86trKuP+Q+WA gD6pML8cxJKgQL40qqWn0O/qK3Ew1R2rNuUTKm1t62PbLteA6yTnmY9x8fOtAH1uyexi LkeJO7pvTRgmohvnwo9sHAYbcJp9FjPOL1Mwm8x2a5+QuTAVN0agXp8gYTiBVk2EfCZy iv7hA9zEx23uDwNzWkfxI7X4iQMwAHJ0Ls2YNcWKdeKZrURdCl5u41lV0KtEL/mXgJkc 2j46iSBjibqqJZC6kucAfWR2FJ7CwFRwtkCd8XlzIQJgkVBMCw8TqUc0tzGoD1pqxpir BQDA== X-Gm-Message-State: APjAAAUUtTVlA0IgxxvpbVF5ju3idunD0fLK29OuFE5+ylWVwoEPACXC LrbNAhrQaUBdK8t/MtIde8QYEYl+35g= X-Google-Smtp-Source: APXvYqx7K4Gt18amX+hLKSOMgjI0zyd/A3QfgpeceRkltPJbTjqHafxczzSCZqTAx0AlbO7TqjQWng== X-Received: by 2002:a62:8789:: with SMTP id i131mr28078223pfe.221.1574604589140; Sun, 24 Nov 2019 06:09:49 -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.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 24 Nov 2019 06:09:48 -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 8/8] thermal: remove kelvin to/from Celsius conversion helpers from Date: Sun, 24 Nov 2019 23:08:50 +0900 Message-Id: <1574604530-9024-9-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-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org This removes the kelvin to/from Celsius conversion helpers in which were switched to helpers. DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET() is only used by ACPI thermal zone driver and the usage is specific to the driver. So this macro is moved to the ACPI thermal driver rather than generic header. 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 | 2 ++ include/linux/thermal.h | 11 ----------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index bd9b6eb..370e114 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -42,6 +42,8 @@ #define ACPI_THERMAL_MAX_ACTIVE 10 #define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65 +#define DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(t, off) (((t) - (off)) * 100) + #define _COMPONENT ACPI_THERMAL_COMPONENT ACPI_MODULE_NAME("thermal"); diff --git a/include/linux/thermal.h b/include/linux/thermal.h index ed549e4..06e1695 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -33,17 +33,6 @@ /* use value, which < 0K, to indicate an invalid/uninitialized temperature */ #define THERMAL_TEMP_INVALID -274000 -/* Unit conversion macros */ -#define DECI_KELVIN_TO_CELSIUS(t) ({ \ - long _t = (t); \ - ((_t-2732 >= 0) ? (_t-2732+5)/10 : (_t-2732-5)/10); \ -}) -#define CELSIUS_TO_DECI_KELVIN(t) ((t)*10+2732) -#define DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(t, off) (((t) - (off)) * 100) -#define DECI_KELVIN_TO_MILLICELSIUS(t) DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(t, 2732) -#define MILLICELSIUS_TO_DECI_KELVIN_WITH_OFFSET(t, off) (((t) / 100) + (off)) -#define MILLICELSIUS_TO_DECI_KELVIN(t) MILLICELSIUS_TO_DECI_KELVIN_WITH_OFFSET(t, 2732) - /* Default Thermal Governor */ #if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE) #define DEFAULT_THERMAL_GOVERNOR "step_wise" -- 2.7.4 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=-9.6 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 5F7D3C432C0 for ; Sun, 24 Nov 2019 14:11:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 306F32073F for ; Sun, 24 Nov 2019 14:11:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MbvS0zNn"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aF+EL/ua" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 306F32073F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=XMznX3twkZoIbcCVCBNLdSpkbbvS4Kcyg6uo0YvpQ1U=; b=MbvS0zNnmoFFLDYgrg1W3JIwha /LDeCsJr7HPQiZB7fl9/lVm0Gb4Qc4BXPjlp+xjUiHxowWNMehASQgECnB16DIlvN8SJE+g1Bl1vP ZePHtTKa/atLqooQQlciV6wl4exVv8D+HfrhPFH8zoFgc6qqH56oFPQKs/xOnc9h+NFamXG2/zKAY 0w113F1BEQOKGjVnldSKP2vCm7sjenibYNfMSfyw155Ai2Yt2Q48xy8IfnuBbANJmLk2bk5mhm4Ma Iy83BFuXhLdEc2pIppheGDu8vfP/N52NfBFY17Wtdi+E9jjRsTQHj3yLcc6mchioZcD0g/wiJPC2o 6D39q/7g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iYsbT-0005uB-3q; Sun, 24 Nov 2019 14:11:07 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iYsaE-0003mf-IR for linux-nvme@lists.infradead.org; Sun, 24 Nov 2019 14:10:05 +0000 Received: by mail-pf1-x443.google.com with SMTP id d199so1331320pfd.11 for ; Sun, 24 Nov 2019 06:09:50 -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=HlZyESYLe6A5DAq1XkhuEkfPsYgeQ0ev4dh7nFf6DlA=; b=aF+EL/uaBuy3BwpoI2oa5LtqP9+p1sZ6VjixxtI6M70GSLCINBULaM3WNiSvJ1WIrZ xIp52aIi0nJQeAktwdoDbbpWpUGRijeoTLe1MAm4hB4Z4WYl9NAkew4iN56rugjskot4 yt0PkQGxQXJReAVRmTDpxgmvwAEprEGHPYHel8zMm9c4Pbf0nfdxKiEAsstWT0AfLR8r bDsPU9XMtHOa1IO5HUXITzT66ktxxcPF+Z9kAYhRpX5dnnkPp6PRQV0tZTGgJfpG2Hcz Q8Q4/16zkCk9xffjh+a8YQwbn/z/50qSQu4mMZdfby+ch8XiXZOg7GCvCrNQfdl2VLIo mnVQ== 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=HlZyESYLe6A5DAq1XkhuEkfPsYgeQ0ev4dh7nFf6DlA=; b=n4sf/aAaNjUKUePCn32Ew/yfIRhUuapcxmBsI6t/cMfri14Bz8lEl0PuPZeiUL+Kgz xEEZ+0EwyfD48UNJgfr8PBSpFCEF0DXeT4I3CNMmgPhmJPA+DWqEbuL7xX7aVCznKKxG zNgxEPgRe5580eVCYgZIzUMcRpKkO/vfKn1sZmSnjATasxwei0GqCKTD4sqNtczHK0Ek wvuDee2M3ZCBz7PXaTOrhO48PSscMwk3v8BsqRzfwmykTN1aDILWQTAN1mO6e/N7XyV+ lRxDlljul8tdvcIDVDPy2LepNYdfeWjsO9zazKHjvzoWnY14Xt+hEPFRFlB+Irb7kdBG FPTg== X-Gm-Message-State: APjAAAXx70COsGs3m78j3kYVr6k6j1X2vqOJYUyHFHnXWIJzg5vsyuxc Di/qCfeFjGZ6yZ3SfeAjZ/y0CU0wc/Y= X-Google-Smtp-Source: APXvYqx7K4Gt18amX+hLKSOMgjI0zyd/A3QfgpeceRkltPJbTjqHafxczzSCZqTAx0AlbO7TqjQWng== X-Received: by 2002:a62:8789:: with SMTP id i131mr28078223pfe.221.1574604589140; Sun, 24 Nov 2019 06:09:49 -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.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 24 Nov 2019 06:09:48 -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 Subject: [PATCH 8/8] thermal: remove kelvin to/from Celsius conversion helpers from Date: Sun, 24 Nov 2019 23:08:50 +0900 Message-Id: <1574604530-9024-9-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191124_060950_755067_5C8D30BD X-CRM114-Status: GOOD ( 13.31 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jens Axboe , Amit Kucheria , Jean Delvare , Sagi Grimberg , Sujith Thomas , Daniel Lezcano , Akinobu Mita , Eduardo Valentin , Guenter Roeck , Keith Busch , Darren Hart , Zhang Rui , Christoph Hellwig , Andy Shevchenko MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org This removes the kelvin to/from Celsius conversion helpers in which were switched to helpers. DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET() is only used by ACPI thermal zone driver and the usage is specific to the driver. So this macro is moved to the ACPI thermal driver rather than generic header. 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 | 2 ++ include/linux/thermal.h | 11 ----------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index bd9b6eb..370e114 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -42,6 +42,8 @@ #define ACPI_THERMAL_MAX_ACTIVE 10 #define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65 +#define DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(t, off) (((t) - (off)) * 100) + #define _COMPONENT ACPI_THERMAL_COMPONENT ACPI_MODULE_NAME("thermal"); diff --git a/include/linux/thermal.h b/include/linux/thermal.h index ed549e4..06e1695 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -33,17 +33,6 @@ /* use value, which < 0K, to indicate an invalid/uninitialized temperature */ #define THERMAL_TEMP_INVALID -274000 -/* Unit conversion macros */ -#define DECI_KELVIN_TO_CELSIUS(t) ({ \ - long _t = (t); \ - ((_t-2732 >= 0) ? (_t-2732+5)/10 : (_t-2732-5)/10); \ -}) -#define CELSIUS_TO_DECI_KELVIN(t) ((t)*10+2732) -#define DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(t, off) (((t) - (off)) * 100) -#define DECI_KELVIN_TO_MILLICELSIUS(t) DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(t, 2732) -#define MILLICELSIUS_TO_DECI_KELVIN_WITH_OFFSET(t, off) (((t) / 100) + (off)) -#define MILLICELSIUS_TO_DECI_KELVIN(t) MILLICELSIUS_TO_DECI_KELVIN_WITH_OFFSET(t, 2732) - /* Default Thermal Governor */ #if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE) #define DEFAULT_THERMAL_GOVERNOR "step_wise" -- 2.7.4 _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme