From patchwork Tue Dec 3 05:23:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 180701 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp1067952ile; Mon, 2 Dec 2019 21:23:50 -0800 (PST) X-Google-Smtp-Source: APXvYqxYpFasfSN3YboQi2pZfH/NuQZiqXKx1x4cBM7jt7J8QmprhYW6ToVY/0ruWH49m2WhUgpA X-Received: by 2002:a9d:75da:: with SMTP id c26mr2053725otl.40.1575350630356; Mon, 02 Dec 2019 21:23:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575350630; cv=none; d=google.com; s=arc-20160816; b=sQGvlJSFvUJP5OUq3/IEbUsNfccZ00SuXTVW7jYk+orR5C7czXeQbYiDY2auOc/O+p 6dBJAUbog+8AiiC9qrPcLh+3dfW+M1cmLkbMqxB8ZF8Nx7PzWUxCAFcidMKY4065dvYj +CdxEgjf03cgKufIOjOn4LeX1iw6bH4zInfHKUvHlRqvnpDg71Z+JjXYj4P+SEP5Tv6o 3YLrX8SMBQyb9ANrTwkZoVb8/VmCwKVfZB/c6OMJYJb1Wu+Nd692l71rLDBWn+0Dhi8j xVB4cbPZBsP7PKH/sgYUV/UtlJdRu9RE0Aqkv7PyI5xPDq9sXG+KFVtIAfBEjPH47XmA t/7w== 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:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=jCnbshc6gwC9Lz7KrpZNRQtAnW1kUNCWIyQg9GLVi8g=; b=bCxkH71IpueEhqtjphhdcZfhfpF5u+HfB5eDPwZ2Yg84OwFlzI0hxE5sM32NnZegTD 1YDSrG1lM0mjf8CMbrVUVgoYzm0J8TgWv0tIZePDcwYWLuZT1tRV7QHyx5jUNjB+ba24 GedSwJPsugSFfa/+xsmkpdk+aGqxchuiVz4FauWArcdKWgLUI9BGgH0ZQZqiprRqNeag YMR/SCMTbo/uD4a5adWEOqoQVLamWA3FoZqmSnA4r97oWqtLM0kDvohJe3lXklZyMNLo h97/URWitJBLqc/hOeX1hMS5i64MgD0kMEJQhgkNhSw09SOi0gg0/FfWfQEyIl0lmiqr JjRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OAsl82Oz; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 x2si688908otk.66.2019.12.02.21.23.49; Mon, 02 Dec 2019 21:23:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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=OAsl82Oz; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1727069AbfLCFXt (ORCPT + 15 others); Tue, 3 Dec 2019 00:23:49 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:42521 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727050AbfLCFXs (ORCPT ); Tue, 3 Dec 2019 00:23:48 -0500 Received: by mail-pg1-f193.google.com with SMTP id i5so1107320pgj.9 for ; Mon, 02 Dec 2019 21:23:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=jCnbshc6gwC9Lz7KrpZNRQtAnW1kUNCWIyQg9GLVi8g=; b=OAsl82OzpSmTAhx0IKBHZKzsbwj/Z21pQqt+a4HJyo/HZFuWYG9T4G04aGZRPpDabt +EEHPB/YWvTT1xhURL6ea6bIVo+plxAXVlqEIbZR06NB9Sh2Wq9iHh9wwy3WlzDu+HTw uFjhM186omJhFZh1qp3s9THXC88LAjvd7sLJd4FM4Em2wk/cI/SNy0/OyPbVGovb4Q69 GJEWRkCGmkBjBwaoIDjgfYabTSvOlon7UJgG4w9P5zJVxHSdgpBOicTCBHw2ZvQPh4M2 bsPl8engt05uk4jXYpdp992AtjFowJHclWUqfPjTgcuzgsI2DEJPaghc7lXxnn+s0Qvw e2qg== 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:in-reply-to:references; bh=jCnbshc6gwC9Lz7KrpZNRQtAnW1kUNCWIyQg9GLVi8g=; b=KcQ5T2Wt+rauWoE5xUpIMAyWilkoS3HesNOq5K0OqS+qSyKgwGVzTNAAjQQu1kE/ED 0rImB2D7gqGUvpfiOC40DSnReVJ2QgcwPfcRTFClH0wB7lf9IrXW7/IvtSLSQZagkdA2 9XsIgsxA1Zhn6tFgOjXjoFu0tAFzt94VPlTVTwd5G7TynCp4KGzoLKgNNrmAUqZRKEiL MOcQoYt3QHm4jlqYh9kRvOh7fdeIs5GktKQTQJkb8laxNki6dgeJS7qGixQiKN3W3XtK 8hUOmD+lnIeecbLCYXbxp8juwTqc5hUUMvmegomspXVFj/XxKTfaNypwjelAom3YW6AZ yPIw== X-Gm-Message-State: APjAAAWD1SYfHM4NwUYxG6yqcXogiox3RwO1ltTpyuj1+fwWcXRKgPKq 81pwDK2kHrGwI/kasMbg7Gtdng== X-Received: by 2002:a63:6787:: with SMTP id b129mr3465932pgc.103.1575350627967; Mon, 02 Dec 2019 21:23:47 -0800 (PST) Received: from localhost ([14.96.109.134]) by smtp.gmail.com with ESMTPSA id z30sm1426685pff.131.2019.12.02.21.23.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Dec 2019 21:23:47 -0800 (PST) From: Amit Kucheria To: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, swboyd@chromium.org, sivaa@codeaurora.org, Andy Gross Cc: Daniel Lezcano , Amit Kucheria , linux-pm@vger.kernel.org Subject: [PATCH v2 3/9] drivers: thermal: tsens: use simpler variables Date: Tue, 3 Dec 2019 10:53:24 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org We already dereference the sensor and save it into a variable. Use the variable directly to make the code easier to read. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens-common.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c index c2df30a08b9e4..1cbc5a6e5b4fd 100644 --- a/drivers/thermal/qcom/tsens-common.c +++ b/drivers/thermal/qcom/tsens-common.c @@ -368,7 +368,7 @@ irqreturn_t tsens_irq_thread(int irq, void *data) tsens_set_interrupt(priv, hw_id, UPPER, disable); if (d.up_thresh > temp) { dev_dbg(priv->dev, "[%u] %s: re-arm upper\n", - priv->sensor[i].hw_id, __func__); + hw_id, __func__); tsens_set_interrupt(priv, hw_id, UPPER, enable); } else { trigger = true; @@ -379,7 +379,7 @@ irqreturn_t tsens_irq_thread(int irq, void *data) tsens_set_interrupt(priv, hw_id, LOWER, disable); if (d.low_thresh < temp) { dev_dbg(priv->dev, "[%u] %s: re-arm low\n", - priv->sensor[i].hw_id, __func__); + hw_id, __func__); tsens_set_interrupt(priv, hw_id, LOWER, enable); } else { trigger = true; @@ -392,7 +392,7 @@ irqreturn_t tsens_irq_thread(int irq, void *data) if (trigger) { dev_dbg(priv->dev, "[%u] %s: TZ update trigger (%d mC)\n", hw_id, __func__, temp); - thermal_zone_device_update(priv->sensor[i].tzd, + thermal_zone_device_update(s->tzd, THERMAL_EVENT_UNSPECIFIED); } else { dev_dbg(priv->dev, "[%u] %s: no violation: %d\n", @@ -435,7 +435,7 @@ int tsens_set_trips(void *_sensor, int low, int high) spin_unlock_irqrestore(&priv->ul_lock, flags); dev_dbg(dev, "[%u] %s: (%d:%d)->(%d:%d)\n", - s->hw_id, __func__, d.low_thresh, d.up_thresh, cl_low, cl_high); + hw_id, __func__, d.low_thresh, d.up_thresh, cl_low, cl_high); return 0; }