From patchwork Fri Jan 31 06:16:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 11359305 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 AAF64139A for ; Fri, 31 Jan 2020 06:16:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 69DDA21734 for ; Fri, 31 Jan 2020 06:16:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="sy6KZ+eD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 69DDA21734 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 08FC86B056D; Fri, 31 Jan 2020 01:16:04 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 016076B056F; Fri, 31 Jan 2020 01:16:03 -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 E1E6B6B0570; Fri, 31 Jan 2020 01:16:03 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0225.hostedemail.com [216.40.44.225]) by kanga.kvack.org (Postfix) with ESMTP id C468A6B056D for ; Fri, 31 Jan 2020 01:16:03 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 8E9024DB3 for ; Fri, 31 Jan 2020 06:16:03 +0000 (UTC) X-FDA: 76436919006.10.head19_34d96bccda624 X-Spam-Summary: 2,0,0,6242149f4728f2f0,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: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:sfr@canb.auug.org.au:sgruszka@redhat.com:sujith.thomas@intel.com:torvalds@linux-foundation.org,RULES_HIT:41:355:379:800:960:967:973:988:989:1260:1263:1345:1359:1381:1431:1437:1535:1544:1711:1730:1747:1777:1792:2194:2199:2393:2525:2559:2565:2682:2685:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3354:3865:3867:3868:3870:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4117:4321:4605:5007:6119 :6261:66 X-HE-Tag: head19_34d96bccda624 X-Filterd-Recvd-Size: 6673 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Fri, 31 Jan 2020 06:16:03 +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 84D6B2464B; Fri, 31 Jan 2020 06:16:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580451362; bh=EyRXcIQcJGNL1GWru20rgF1q0c69KG0W/PaDTAMrjbg=; h=Date:From:To:Subject:In-Reply-To:From; b=sy6KZ+eDJyUNYCiG4xZXXL1sRQMJBLk1Cj+lxEbtinGMjtYez2RKa0/jzKghyluYN BbYiiTWW9eDoO1vt810bF+aOCy+HT4M5HriEJ9mXRXussm0JkSIxx1JsJcalOcO0Mo iTwst12zC2t5KduTFdlvIhYWlLCdxilfJ6ZdZiVc= Date: Thu, 30 Jan 2020 22:16:01 -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, 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, sfr@canb.auug.org.au, sgruszka@redhat.com, sujith.thomas@intel.com, torvalds@linux-foundation.org Subject: [patch 089/118] iwlegacy: use helpers Message-ID: <20200131061601.0zJ4Z5TVF%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: iwlegacy: use helpers This switches the iwlegacy driver to use celsius_to_kelvin() and kelvin_to_celsius() in . [akinobu.mita@gmail.com: fix build warnings with format string] Link: http://lkml.kernel.org/r/1579014483-9226-1-git-send-email-akinobu.mita@gmail.com Link: https://lore.kernel.org/r/20200106171452.201c3b4c@canb.auug.org.au Link: http://lkml.kernel.org/r/1576386975-7941-10-git-send-email-akinobu.mita@gmail.com Signed-off-by: Akinobu Mita Reviewed-by: Andy Shevchenko Acked-by: Kalle Valo Cc: Kalle Valo Cc: Stanislaw Gruszka Cc: Amit Kucheria Cc: Andy Shevchenko Cc: Christoph Hellwig Cc: Daniel Lezcano Cc: Darren Hart Cc: Emmanuel Grumbach Cc: Guenter Roeck Cc: Hartmut Knaack Cc: Jean Delvare Cc: Jens Axboe Cc: Johannes Berg Cc: Jonathan Cameron Cc: Keith Busch Cc: Lars-Peter Clausen Cc: Luca Coelho Cc: Peter Meerwald-Stadler Cc: Sagi Grimberg Cc: Sujith Thomas Cc: Zhang Rui Cc: Stephen Rothwell Signed-off-by: Andrew Morton --- drivers/net/wireless/intel/iwlegacy/4965-mac.c | 3 +- drivers/net/wireless/intel/iwlegacy/4965.c | 17 +++++++-------- drivers/net/wireless/intel/iwlegacy/common.h | 3 -- 3 files changed, 11 insertions(+), 12 deletions(-) --- a/drivers/net/wireless/intel/iwlegacy/4965.c~iwlegacy-use-linux-unitsh-helpers +++ a/drivers/net/wireless/intel/iwlegacy/4965.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -1104,7 +1105,7 @@ il4965_fill_txpower_tbl(struct il_priv * /* get current temperature (Celsius) */ current_temp = max(il->temperature, IL_TX_POWER_TEMPERATURE_MIN); current_temp = min(il->temperature, IL_TX_POWER_TEMPERATURE_MAX); - current_temp = KELVIN_TO_CELSIUS(current_temp); + current_temp = kelvin_to_celsius(current_temp); /* select thermal txpower adjustment params, based on channel group * (same frequency group used for mimo txatten adjustment) */ @@ -1610,8 +1611,8 @@ il4965_hw_get_temperature(struct il_priv temperature = (temperature * 97) / 100 + TEMPERATURE_CALIB_KELVIN_OFFSET; - D_TEMP("Calibrated temperature: %dK, %dC\n", temperature, - KELVIN_TO_CELSIUS(temperature)); + D_TEMP("Calibrated temperature: %dK, %ldC\n", temperature, + kelvin_to_celsius(temperature)); return temperature; } @@ -1670,12 +1671,12 @@ il4965_temperature_calib(struct il_priv if (il->temperature != temp) { if (il->temperature) - D_TEMP("Temperature changed " "from %dC to %dC\n", - KELVIN_TO_CELSIUS(il->temperature), - KELVIN_TO_CELSIUS(temp)); + D_TEMP("Temperature changed " "from %ldC to %ldC\n", + kelvin_to_celsius(il->temperature), + kelvin_to_celsius(temp)); else - D_TEMP("Temperature " "initialized to %dC\n", - KELVIN_TO_CELSIUS(temp)); + D_TEMP("Temperature " "initialized to %ldC\n", + kelvin_to_celsius(temp)); } il->temperature = temp; --- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c~iwlegacy-use-linux-unitsh-helpers +++ a/drivers/net/wireless/intel/iwlegacy/4965-mac.c @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -6468,7 +6469,7 @@ il4965_set_hw_params(struct il_priv *il) il->hw_params.valid_rx_ant = il->cfg->valid_rx_ant; il->hw_params.ct_kill_threshold = - CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD_LEGACY); + celsius_to_kelvin(CT_KILL_THRESHOLD_LEGACY); il->hw_params.sens = &il4965_sensitivity; il->hw_params.beacon_time_tsf_bits = IL4965_EXT_BEACON_TIME_POS; --- a/drivers/net/wireless/intel/iwlegacy/common.h~iwlegacy-use-linux-unitsh-helpers +++ a/drivers/net/wireless/intel/iwlegacy/common.h @@ -779,9 +779,6 @@ struct il_sensitivity_ranges { u16 nrg_th_cca; }; -#define KELVIN_TO_CELSIUS(x) ((x)-273) -#define CELSIUS_TO_KELVIN(x) ((x)+273) - /** * struct il_hw_params * @bcast_id: f/w broadcast station ID