From patchwork Fri Jan 31 06:15:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 11359291 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 43D83139A for ; Fri, 31 Jan 2020 06:15:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 10F7E20663 for ; Fri, 31 Jan 2020 06:15:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="nBbOCWiJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 10F7E20663 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0DE286B0561; Fri, 31 Jan 2020 01:15:40 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 03C716B0563; Fri, 31 Jan 2020 01:15:39 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD2776B0564; Fri, 31 Jan 2020 01:15:39 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0181.hostedemail.com [216.40.44.181]) by kanga.kvack.org (Postfix) with ESMTP id C35AB6B0561 for ; Fri, 31 Jan 2020 01:15:39 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7F4D7181AEF10 for ; Fri, 31 Jan 2020 06:15:39 +0000 (UTC) X-FDA: 76436917998.25.earth81_315a510f6f802 X-Spam-Summary: 2,0,0,d905384eea5efa04,d41d8cd98f00b204,akpm@linux-foundation.org,:akinobu.mita@gmail.com:akpm@linux-foundation.org:amit.kucheria@verdurent.com:andy.shevchenko@gmail.com:andy@infradead.org:axboe@fb.com:daniel.lezcano@linaro.org:dvhart@infradead.org:emmanuel.grumbach@intel.com:hch@lst.de:jdelvare@suse.com:jic23@kernel.org:johannes.berg@intel.com:jonathan.cameron@huawei.com:kbusch@kernel.org:knaack.h@gmx.de:kvalo@codeaurora.org:lars@metafoo.de::linux@roeck-us.net:luciano.coelho@intel.com:mm-commits@vger.kernel.org:pmeerw@pmeerw.net:rui.zhang@intel.com:sagi@grimberg.me:sgruszka@redhat.com:sujith.thomas@intel.com:torvalds@linux-foundation.org,RULES_HIT:41:355:379:800:857:960:967:973:988:989:1260:1263:1345:1359:1381:1431:1437:1534:1542:1711:1730:1747:1777:1792:2393:2525:2559:2563:2682:2685:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3865:3867:3870:3871:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4605:5007:6261:665 3:6737:6 X-HE-Tag: earth81_315a510f6f802 X-Filterd-Recvd-Size: 4351 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Fri, 31 Jan 2020 06:15:39 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (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 892DA214D8; Fri, 31 Jan 2020 06:15:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580451338; bh=0Qzuj+jv7z3XueCf75sJe6aM3pRSq1K7lk0jfXaaIuM=; h=Date:From:To:Subject:In-Reply-To:From; b=nBbOCWiJgb8AdrzNnnbiFEywhp+02v5E7sGdSt/GH3/ej1l2FcAmIg97FTW2fUa7l c/oZkcVbRoR6vtdap0y4dONk7AdqdU23YC59tvqRCv2RiwpyJbyBHf+H/MwPqXTi2i hsB4BoSS6ke3WH6SdY1RX8RXNT8rUGN4vIEkAlM0= Date: Thu, 30 Jan 2020 22:15:37 -0800 From: Andrew Morton To: akinobu.mita@gmail.com, akpm@linux-foundation.org, amit.kucheria@verdurent.com, andy.shevchenko@gmail.com, andy@infradead.org, axboe@fb.com, daniel.lezcano@linaro.org, dvhart@infradead.org, emmanuel.grumbach@intel.com, hch@lst.de, jdelvare@suse.com, jic23@kernel.org, johannes.berg@intel.com, Jonathan.Cameron@huawei.com, kbusch@kernel.org, knaack.h@gmx.de, kvalo@codeaurora.org, lars@metafoo.de, linux-mm@kvack.org, linux@roeck-us.net, luciano.coelho@intel.com, mm-commits@vger.kernel.org, pmeerw@pmeerw.net, rui.zhang@intel.com, sagi@grimberg.me, sgruszka@redhat.com, sujith.thomas@intel.com, torvalds@linux-foundation.org Subject: [patch 083/118] platform/x86: asus-wmi: switch to use helpers Message-ID: <20200131061537.9zc7Bjgih%akpm@linux-foundation.org> In-Reply-To: <20200130221021.5f0211c56346d5485af07923@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Akinobu Mita Subject: platform/x86: asus-wmi: switch to use helpers The asus-wmi driver doesn't implement the thermal device functionality directly, so including just for DECI_KELVIN_TO_CELSIUS() is a bit odd. This switches the asus-wmi driver to use deci_kelvin_to_millicelsius() in . The format string is changed from %d to %ld due to function returned type. Link: http://lkml.kernel.org/r/1576386975-7941-4-git-send-email-akinobu.mita@gmail.com Signed-off-by: Akinobu Mita Acked-by: Andy Shevchenko Cc: Sujith Thomas Cc: Darren Hart Cc: Andy Shevchenko Cc: Zhang Rui Cc: Daniel Lezcano Cc: Amit Kucheria Cc: Jean Delvare Cc: Guenter Roeck Cc: Keith Busch Cc: Jens Axboe Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Emmanuel Grumbach Cc: Hartmut Knaack Cc: Johannes Berg Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Kalle Valo Cc: Lars-Peter Clausen Cc: Luca Coelho Cc: Peter Meerwald-Stadler Cc: Stanislaw Gruszka Signed-off-by: Andrew Morton --- drivers/platform/x86/asus-wmi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/drivers/platform/x86/asus-wmi.c~platform-x86-asus-wmi-switch-to-use-linux-unitsh-helpers +++ a/drivers/platform/x86/asus-wmi.c @@ -33,9 +33,9 @@ #include #include #include -#include #include #include +#include #include #include @@ -1514,9 +1514,8 @@ static ssize_t asus_hwmon_temp1(struct d if (err < 0) return err; - value = DECI_KELVIN_TO_CELSIUS((value & 0xFFFF)) * 1000; - - return sprintf(buf, "%d\n", value); + return sprintf(buf, "%ld\n", + deci_kelvin_to_millicelsius(value & 0xFFFF)); } /* Fan1 */