Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10701358imu; Thu, 6 Dec 2018 05:31:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/WdygKOxaEum6sCdWavGshkEcDc8aLujoX3KTFbzDEeZNUJ5FTn7q89q31osIOWuBW/sH0g X-Received: by 2002:a17:902:8f97:: with SMTP id z23mr28715468plo.283.1544103089588; Thu, 06 Dec 2018 05:31:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544103089; cv=none; d=google.com; s=arc-20160816; b=iMIsEF31Tv/jxlyIaj8KSo99wHjlxvUEeLCprQGdVLhOJ7njNP8hwvxQWjIakNVFwy 8mczdmaYiKjC+j8rGdqgWw5Eb9IDIYR4qDoi1g7o53E1nbNPMBZS9T7GgEZsSJcvII5f k98sgCwumGSMULGwYIbhPGldOTNeCjAziauhoZQBlbMHGCZ4y+ammUPpbkveokXxBpuC xfYaWMfCkBtNtjSDJiSNrH4RaqJv1oWwHAnCvbdzJvdOCXQ77TwRqlubnJBlWLTCheyl m3fkLK8DxCKmFqoB3pgi2c+1aVUlyE2SGxjIkQWMtv0eneilAvFs+5Sok/HQj6AycOHB D5hQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=mfKJIijKVOHLPxQxvHmWc2C5JM72MrjkRIP4pXrZkWY=; b=Ip2f1V5cHcKyFQe6LcQWuJB+EZiaHf3qAx2QQb0M2yWPfMyBX2icIeCj9+j1UPjcJj XqRQT2Cv+SgDw35UfF7iVyCVTF4TBlFyyoeO6hvFV6B5tgHdBaQ8uY2BuXK13v2SqKIk m0hggS0gmqNHDLN2zec1HrR3q71ZOSi/rjon/58LBFyZ2ZpCVaqzfXWBCYTkIMO6AskB WekY3ZhtOIWx7wLM5J2s2FdKSCF3p4efqNYNI5d4c0zlUh8odxeHyGll75M6AAlQPa5o BT4jfcPULLiXMB6sF1WA8zRpMEzHyJ18SVwL9/fWSqOn2R2A7LChV70GsqXmEDDgaCBG KHng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T+tWArTR; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9si276187pli.418.2018.12.06.05.31.09; Thu, 06 Dec 2018 05:31:29 -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=@linaro.org header.s=google header.b=T+tWArTR; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729356AbeLFNaJ (ORCPT + 99 others); Thu, 6 Dec 2018 08:30:09 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46177 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728683AbeLFNaJ (ORCPT ); Thu, 6 Dec 2018 08:30:09 -0500 Received: by mail-wr1-f68.google.com with SMTP id l9so447391wrt.13 for ; Thu, 06 Dec 2018 05:30:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=mfKJIijKVOHLPxQxvHmWc2C5JM72MrjkRIP4pXrZkWY=; b=T+tWArTRgEaGFepCTqL+yHUkCUwdYkZiRNqw62iqM7J9KqQE/732sl2xnIGGszjuuQ F0sQzmgQQAiCkLLNvjK0dsMHBMTTM/vvyxvZSmnL9xW360xDhx10xkg6tIiChghlHh46 tIIhhKB27dHUNplFNMbLZhg0bnP6A8NE+bFQM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mfKJIijKVOHLPxQxvHmWc2C5JM72MrjkRIP4pXrZkWY=; b=VhRdEQJ7QGIZ6ErXVlZcsmgNYLqYvKhNC7RR+MhTX772bS/oxou59NYwVxNOJAEpwB EHZKDUp6JlACPir6D+QiFMKg74+JEL58UTiFrCXbK0yZ8H468TR3I2ksf2Fs42SgRILp 8aLtOMA/160iW3QSS2OREgKGh06IHuTaqX/dtx+wGc4KGC4Vl1Cz/JtpuVzGmxkHiXkj T5TSvgJe7gj7XrFo99q10W1pqG3N91p+gfoMMjrLYv6h9aZx//yG6/MbSK8ya3q3ywRO Dq/FdJhWkbLT55WP6salcHUpOchH0TY++PRDxfYDVArWHEGIu5tuujA2p9W9LboQtL1f plkQ== X-Gm-Message-State: AA+aEWbJwq+zNhtCl4bPRFtQBCu+GJRkxqcl+NkqhLfpgYbaGWe1H7Jx DXAVAgZt3Rju3RIWEwAAiBaWaw== X-Received: by 2002:adf:fbc8:: with SMTP id d8mr21909447wrs.318.1544103007242; Thu, 06 Dec 2018 05:30:07 -0800 (PST) Received: from [192.168.0.40] (172.220.136.77.rev.sfr.net. [77.136.220.172]) by smtp.googlemail.com with ESMTPSA id c9sm1406802wmh.27.2018.12.06.05.30.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 05:30:06 -0800 (PST) Subject: Re: [PATCH] thermal: stm32: Fix stm_thermal_read_factory_settings To: David HERNANDEZ SANCHEZ , Zhang Rui , Eduardo Valentin , Rob Herring , Mark Rutland , Maxime Coquelin , Alexandre TORGUE Cc: "linux-pm@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" References: <1544102603-14899-1-git-send-email-david.hernandezsanchez@st.com> From: Daniel Lezcano Message-ID: Date: Thu, 6 Dec 2018 14:30:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1544102603-14899-1-git-send-email-david.hernandezsanchez@st.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/12/2018 14:23, David HERNANDEZ SANCHEZ wrote: > Adding brackets allows to multiply the register value, > masked by TS1_RAMP_COEFF_MASK, by an ADJUST value > properly and not to multiply ADJUST by register value and > then mask the whole. > > Signed-off-by: David Hernandez Sanchez > Fixes: 1d693155 ("thermal: add stm32 thermal driver") Usually 'Fixes' comes first in the list. Other than that: Reviewed-by: Daniel Lezcano > diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c > index daa1257..bbd73c5 100644 > --- a/drivers/thermal/st/stm_thermal.c > +++ b/drivers/thermal/st/stm_thermal.c > @@ -241,8 +241,8 @@ static int stm_thermal_read_factory_settings(struct stm_thermal_sensor *sensor) > sensor->t0 = TS1_T0_VAL1; > > /* Retrieve fmt0 and put it on Hz */ > - sensor->fmt0 = ADJUST * readl_relaxed(sensor->base + DTS_T0VALR1_OFFSET) > - & TS1_FMT0_MASK; > + sensor->fmt0 = ADJUST * (readl_relaxed(sensor->base + > + DTS_T0VALR1_OFFSET) & TS1_FMT0_MASK); > > /* Retrieve ramp coefficient */ > sensor->ramp_coeff = readl_relaxed(sensor->base + DTS_RAMPVALR_OFFSET) & > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog