From patchwork Thu Apr 22 11:34:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 425857 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp272262jao; Thu, 22 Apr 2021 04:35:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMYIjP9f01EDnE7any7FKIQv+wuobMEAmwOg/065k/F2UCgrSNUBicp9b+OIaeitj68tII X-Received: by 2002:a17:906:8551:: with SMTP id h17mr2859742ejy.377.1619091312276; Thu, 22 Apr 2021 04:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619091312; cv=none; d=google.com; s=arc-20160816; b=jJ0D2fqYGPYsVkI94skHaUR2kgYGa1OhtUGml2lSdic3zE80tqS3Q16qEad3YhEmJw LjM+VwLUV0FteEuyDrmuvHrQxX+YazUC/QfYkXxu28e52yLbZ0VTmfylBRMWNXcQWKvo bvfuqukFtHZWTcOaP6An7NgUUIaHfOLYOjmYqHmMPvJdZki+d+QOfqJDTSDYNbXJnWWw 6VOL65hb15SaTtqAJpcQ9vPgSaIYNPn19a5H9SMlE6XF8DRGPgZuwr19BN2KKqWhWjWQ 2XuB+gRGx3K0PWgcgnVlnv2F3kCHSDX24bA09Q0SiCqed4ifkUo9+KYNeNjJJHpx+Le+ TehA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=nesQIfMK+IRA17P6tXXIkpXFOP6516pK+CAAmZXiyyQ=; b=BeJ6YnCecITYBVp8yx4YTSDTS8ERprT57z+NpVgMdw/hYzw6P2RDPGk0Q9/X79FFw8 AmViCgpeKij6v7M0cVRSa7AIaOmpFai5t5SS5izUM3ULMTTon6xAfvZPdXAwsNsrVq26 7SSvpiM9xLkqMKQT2+Te+9Y1FAhWA96Vuv920VDMOHEFwPFCb2OVvqlZdVrs/EaZLjPy XNe6pH8JtL45kahnuXR0aJcT4lb9c1V4EQClSoBg2JXH1xwyN7I/Dl+SjhvFFeXjTobN KsxqH+1P5HJKk/qOTU37Zw0ihaJXJ8R9MydNTvKCECbIkWDzDkdKrwVYywNnSKG7q/Uw JtcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RhrVbOBr; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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. [23.128.96.18]) by mx.google.com with ESMTP id y6si2229222edl.342.2021.04.22.04.35.11; Thu, 22 Apr 2021 04:35:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RhrVbOBr; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 S236070AbhDVLfp (ORCPT + 8 others); Thu, 22 Apr 2021 07:35:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230510AbhDVLfo (ORCPT ); Thu, 22 Apr 2021 07:35:44 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDE77C06174A for ; Thu, 22 Apr 2021 04:35:09 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id c15so35505420wro.13 for ; Thu, 22 Apr 2021 04:35:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nesQIfMK+IRA17P6tXXIkpXFOP6516pK+CAAmZXiyyQ=; b=RhrVbOBr+ZTTZC+LRLoruKwjZQua0h/acVoW8lowAFUm8W5rEJoG/dfoHoWhb7uDtI AcqAzJyW9K4jtEvSpb3omnXZyrhFCUf0bDScialHScz3A3olefuHdblE81bLIvnyldiz ZLsNSuu1vXzo4Y5VPGI5dLRWEnBhbWU4B40epR0mdVf2/wMmnZBGy5bVqnMw0oaJatxN PF06h6EvcN/FQA7QtA42pX5cYZQLY5OHANW97/uTQs3ssu8td7zj/4Vf/HIrbZyVQ0OW lWazLWPKaLfZaV6hOGlTKpv/hz6vFFqH9wpSXd878rubD0Kbeykkq2uvCtQkVElEF1Ny /ZRA== 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:mime-version :content-transfer-encoding; bh=nesQIfMK+IRA17P6tXXIkpXFOP6516pK+CAAmZXiyyQ=; b=O7k8NAlvZOvdFC8SkIUmyw3xyDC57+6B/xeXkgAXvQ5m2S7b6TCMwqqkIk6itGlLov uii5cNAmxQBbT6Mda0NSu0yN7RrWQQrCp2cgeC6XLzgwzFteqrGxq4qOEwaRJAov9QNb xn8cfI41lhxcI4QKxpgiOQN2pFJQCUCCbaXYAP726IedHYukc+phm4HuFNo7ldNARApQ LjLOls58gqktYsGwPQE8omiLsRK+cJ58igaxzeORmPghTA3kAx9rT90IkerWWBX3IL3x 8A30+iybjmeT6AaMdv9UsuPE7NdHUR9WpYCQcdagQGjiQdSDxKQpfhXRfyZC6ZSeQ1IN UT+A== X-Gm-Message-State: AOAM5302SDaqWTGtbUfzgBFDQpTI6qgZ2X75fVS9CcvrzZ7cohZq8EkH vkC814rJT5pk36bUrTBBOYwdGQ== X-Received: by 2002:adf:f80c:: with SMTP id s12mr3657463wrp.115.1619091308380; Thu, 22 Apr 2021 04:35:08 -0700 (PDT) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:e88d:2580:c20:b786]) by smtp.gmail.com with ESMTPSA id u6sm3237890wml.23.2021.04.22.04.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Apr 2021 04:35:07 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org Cc: Zhang Rui , Amit Kucheria , Thierry Reding , Jonathan Hunter , dingsenjie , Bhaskar Chowdhury , linux-pm@vger.kernel.org (open list:THERMAL), linux-tegra@vger.kernel.org (open list:TEGRA ARCHITECTURE SUPPORT), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/2] thermal/drivers/tegra: Remove a pointless call get_thermal_instance() Date: Thu, 22 Apr 2021 13:34:55 +0200 Message-Id: <20210422113457.51578-1-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The driver is calling get_thermal_instance() but the lookup can happen directly. Remove the call to get_thermal_instance(). Signed-off-by: Daniel Lezcano --- drivers/thermal/tegra/soctherm.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c index 8e303e9d1dc0..355fdf32cbc1 100644 --- a/drivers/thermal/tegra/soctherm.c +++ b/drivers/thermal/tegra/soctherm.c @@ -621,9 +621,8 @@ static int tegra_thermctl_set_trip_temp(void *data, int trip, int temp) continue; cdev = ts->throt_cfgs[i].cdev; - if (get_thermal_instance(tz, cdev, trip)) - stc = find_throttle_cfg_by_name(ts, cdev->type); - else + stc = find_throttle_cfg_by_name(ts, cdev->type); + if (!stc) continue; return throttrip_program(dev, sg, stc, temp); @@ -806,9 +805,8 @@ static int tegra_soctherm_set_hwtrips(struct device *dev, continue; cdev = ts->throt_cfgs[i].cdev; - if (get_thermal_instance(tz, cdev, trip)) - stc = find_throttle_cfg_by_name(ts, cdev->type); - else + stc = find_throttle_cfg_by_name(ts, cdev->type); + if (!stc) continue; ret = throttrip_program(dev, sg, stc, temperature);