From patchwork Tue Dec 22 18:11:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 346648 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp5554577jai; Tue, 22 Dec 2020 10:13:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8+Vbkf09sJ7NYlGMb5tIaai9Vr8G+kr0JMW8N38Mc2FI0Dndcsza0ZQfXHKZN/C+aDj7/ X-Received: by 2002:a17:906:77c5:: with SMTP id m5mr20579047ejn.424.1608660816214; Tue, 22 Dec 2020 10:13:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608660816; cv=none; d=google.com; s=arc-20160816; b=cjCSySKgoAKQx4Z+gLM0Ur8Fe9H588NQIc8l9lg9GSaT2azYKaajI6Eq6kiWnvQueN E/PxtRpQoHy4xHaq2Gky0ZEqtCTmzW0xlgYKJfhqdIdjVP0C0PzB3kZ54TPNoIACIRjS ZgEIdVDgskeTuqCrXIq6IU9wEll1GLss+/8vh63DgXUQ3winY5VKdtwReJP62F7hzyxd uAamX6uRZdVFQEPo6MxCSPIPYaMUcniplzVyLO8Y/+H56ZLs7DLJ92LIiGrQTZ1fHVzu oCwCj0C/pSCbvpzeroz9AICfBipTAIFGxzkQ0Rxbgyf7VEGZNQMwyt6d4pYYMX3HtcdC J34w== 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=GL5aY/W2SVxnORwgM+Hn8h/zHwFy35a3ciduRd4uE84=; b=QFOkMFcLj4qBLV07KP9esTTLNluPLmtM/cuHXh2yh2sb+vF+YTtEsWm8J485fdSBM2 ug9olaRbI5yJJGeNOBCrDrq83UYaspSujL9LsHha4rKVZUEUP0IiV4XLgSf5RBuNJMHQ kxcmdNuS2bqoAKpQ+Gh4HgLVLNQKXmAwaPqGuAJsRtMllCDtsBEsl/S2o92mvqAa7lR/ bVgUquMD7Cpd4Km6Vt4wROXqmGfI3FqMLIiXRViMtw7v+5RRjhWo69asYb1goi4mfMuL /KMvAj8+FeWap9FR8qkxFhfPtu3W2gCoT+YTrELjDQpj9VDPqRd0xHPHbgBO4JQRGXIm 4XNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FlVE6nft; 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 bs24si12732568edb.519.2020.12.22.10.13.35; Tue, 22 Dec 2020 10:13:36 -0800 (PST) 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=FlVE6nft; 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 S1727943AbgLVSME (ORCPT + 8 others); Tue, 22 Dec 2020 13:12:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727936AbgLVSMD (ORCPT ); Tue, 22 Dec 2020 13:12:03 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 462A1C061793 for ; Tue, 22 Dec 2020 10:11:23 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id t30so15429140wrb.0 for ; Tue, 22 Dec 2020 10:11:23 -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:mime-version :content-transfer-encoding; bh=GL5aY/W2SVxnORwgM+Hn8h/zHwFy35a3ciduRd4uE84=; b=FlVE6nftUwDWVsheKFkSpCEnBr8DDum+VdgxgfRSCTndL4/2yzAwiK85Ur56cKMpoN 5dyWQM2T90Toszm/9cJFBicr0y3AAwCf4EXkA73q0419va8lSPG4d8MEUO9nJjCOD43Z 23RNgDjNlqMid7GhfYiA5rvZyplWHXVDrARjoBUUfzKUy5GNroAMlVkwFKS10cWdgPLR Ew3mR8TrNuHjrcL3ERvndmV/xWwS3LQtDPQwd3Oa9rIaDYKiwyJhnM5x4pikgUwkDjr8 lfQ6xxLT4BCIxwJyUv0QHrf/mlhhlABm1jCKjNa+WYoB0jmlGPcKcru9dlGjKKKo4frR HAMw== 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=GL5aY/W2SVxnORwgM+Hn8h/zHwFy35a3ciduRd4uE84=; b=iLeNoSXpJtu4n0hc/wHx0JP7FMHqQZFGYf26cfD9Io+/Tu3KzqgvM5R0yEWyaSQh9V V9IsNnKnn9/bEe2sjBqT9JVAe4Krd/Hl/R2F0lKKfb68lqHFa3uO7q9li1Gd/qYvVZ5v YIlxDHolWoRvoJ7X8TDL+ABASVgtBuufCRy9gJtj/IInWsK/pJqescmfU0ugFLShdGUw 5g6PYzzcoJORYurOEtt91mIOLcGUGAtuv66qcJMyOtEA/9zJYZVkZ3b1FPqJcu8yWHJk uMBKcVzf6w4cpc4fKroMdPZNykkWQ2TJ42Pas4JF+ys9RJjcfxwAg8I6ouwgYaGmVkB4 uM4g== X-Gm-Message-State: AOAM531qCkR53BQsrde1z5iWp7qabaHzFuMoouf4nzwSOOQNgyjKB208 PA1JUPnuWua3nd/UsKuyQBrktA== X-Received: by 2002:a5d:5401:: with SMTP id g1mr25183984wrv.93.1608660681758; Tue, 22 Dec 2020 10:11:21 -0800 (PST) Received: from mai.imgcgcw.net (lns-bzn-59-82-252-148-164.adsl.proxad.net. [82.252.148.164]) by smtp.gmail.com with ESMTPSA id m8sm28061971wmc.27.2020.12.22.10.11.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Dec 2020 10:11:21 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: Amit Kucheria , linux-pm@vger.kernel.org (open list:THERMAL), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] thermal/core: Remove pointless thermal_zone_device_reset() function Date: Tue, 22 Dec 2020 19:11:10 +0100 Message-Id: <20201222181110.1231977-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 function thermal_zone_device_reset() is called in the thermal_zone_device_register() which allocates and initialize the structure. The passive field is already zero-ed by the allocation, the function is useless. Call directly thermal_zone_device_init() instead and thermal_zone_device_reset(). Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) -- 2.25.1 diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index b2615449b18f..996c038f83a4 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -478,12 +478,6 @@ static void thermal_zone_device_init(struct thermal_zone_device *tz) pos->initialized = false; } -static void thermal_zone_device_reset(struct thermal_zone_device *tz) -{ - tz->passive = 0; - thermal_zone_device_init(tz); -} - static int thermal_zone_device_set_mode(struct thermal_zone_device *tz, enum thermal_device_mode mode) { @@ -1363,7 +1357,7 @@ thermal_zone_device_register(const char *type, int trips, int mask, INIT_DELAYED_WORK(&tz->poll_queue, thermal_zone_device_check); - thermal_zone_device_reset(tz); + thermal_zone_device_init(tz); /* Update the new thermal zone and mark it as already updated. */ if (atomic_cmpxchg(&tz->need_update, 1, 0)) thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);