From patchwork Sun Aug 13 02:52:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Rui" X-Patchwork-Id: 135003 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp2045583vqi; Sat, 12 Aug 2023 23:02:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHh9jKdlUsmsmvmZUiklyQDsYAYHbHthaAYo2y9GVjhQkE2nuG1DxdWjTS1RJ6lyMkMrQAK X-Received: by 2002:a17:903:32d1:b0:1bc:4f04:17f9 with SMTP id i17-20020a17090332d100b001bc4f0417f9mr5873286plr.9.1691906523913; Sat, 12 Aug 2023 23:02:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691906523; cv=none; d=google.com; s=arc-20160816; b=xOQm7R/LxSVBto3YRSHcKw23//NnTKklLQN8wPhkW0Jr0h7LRPVokWQQ6iI4SiK+Ng agQKWMI4OVaU9qjbhpGepW1tC8wlovPOrPAk+jFNe+e9tcvUPH0wihsH//5O0AY1CGy0 lC5IhGQeUKz593MAf4/iCu2a0OnhT0podNkYJ0hd6fEuZE+A0kfR5kDPZGB8vipoWE+j PPzuMNF5I9BiK45X9wIOEs2/nzVYR3Di+kru1XS1m+nr7+FXthRc7SxiV3w+VdZSFnRb 1r+yVbsQ14H4FDoYIGMYj8TRICoG1YkLfIZxmqu0B4GHPWiUaHTX99RlQ10iZkRIHYac ebow== 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=y4DGAxSgEgsf5jPr02j/KFMYGAHGRT3ELWSzK87EUco=; fh=4VXEjKdTtZvdJuv1piSI/C6fhkuf5wcOx6Z3K8uxANU=; b=nDgDvVtbVfpf/1sN9/zMjhgOjVrDGUQV1arR9fEMXE/3T4ZxpDpn7Y0WJwPnpTwAOu xzlUNKaWM7M1gyFf6Wfgi3b0AWpvYnRbPv0I4O+upE4XdkPn9e0AWpIPAj5XGFh8BQ9L ErCJnrmSIqvSNooo2xSjltUJ2mJ7LCDX2AOOMt5lrvTtWw3qItN79OE5ZAsBmI8JEK9O eobQF1I6dN2UZFHoexK5pZupe3/OJyNBGjlK4EXPk2K4/cApykJn4szdwihCOm7JdKkl DOvCQd6U4bTdO89YD5wfruPro8g6Bbjj0GOk53AMYN0LuQYojUfo3D3/eQGGBqaopyIu tXhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fUODolnN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k12-20020a170902d58c00b001b9d5f07068si5901780plh.585.2023.08.12.23.01.40; Sat, 12 Aug 2023 23:02:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fUODolnN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229795AbjHMCwf (ORCPT + 99 others); Sat, 12 Aug 2023 22:52:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbjHMCwe (ORCPT ); Sat, 12 Aug 2023 22:52:34 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BFE9170A; Sat, 12 Aug 2023 19:52:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691895155; x=1723431155; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ayErGxhRHllzcsmwaeQTU9qCRuFG7WI+4RAgT9UUgu8=; b=fUODolnNdp2RRSymIvAVwGyAwYod0K7UOjKK4k4pLziCd6vliRl1EveH vMZX7SfNKmErGSRW3RYSMLhBS/sgbV1KN0wWHEhHELICxKGJNlM+c8luy I9KFUTYReutIEF1scPt4+NQfcu9zuBOppXC8QYJJpQ3aBQg/1OZeVbB+X /NF+4USC6x5AOZU68g+QIn+dtWlEfQW17DPIdRTTEOiWj+B+KXzIu4X8d z0V+wOuqs6EWFebNm4qzzEhrPCGtsabT932gtJ5ggSaHtCa6zXYcVY7Gd GVtkTBsmFiXBVhw/XvjXFN7f9izf3ZwfJSCKEk/jRjCpsXb9Fut0LjWkT Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10800"; a="356823901" X-IronPort-AV: E=Sophos;i="6.01,169,1684825200"; d="scan'208";a="356823901" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2023 19:52:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10800"; a="762570867" X-IronPort-AV: E=Sophos;i="6.01,169,1684825200"; d="scan'208";a="762570867" Received: from yingyuel-mobl.ccr.corp.intel.com (HELO rzhang1-mobl7.ccr.corp.intel.com) ([10.255.29.168]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2023 19:52:32 -0700 From: Zhang Rui To: rafael.j.wysocki@intel.com Cc: daniel.lezcano@linaro.or, srinivas.pandruvada@intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH V2] thermal: intel: intel_soc_dts_iosf: Remove redundant check Date: Sun, 13 Aug 2023 10:52:20 +0800 Message-Id: <20230813025220.1752489-1-rui.zhang@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774092575092705797 X-GMAIL-MSGID: 1774092575092705797 Remove the redundant check in remove_dts_thermal_zone() because all of its existing callers pass a valid pointer as the argument. Signed-off-by: Zhang Rui --- drivers/thermal/intel/intel_soc_dts_iosf.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/intel/intel_soc_dts_iosf.c b/drivers/thermal/intel/intel_soc_dts_iosf.c index db97499f4f0a..22fc2970c67d 100644 --- a/drivers/thermal/intel/intel_soc_dts_iosf.c +++ b/drivers/thermal/intel/intel_soc_dts_iosf.c @@ -245,11 +245,9 @@ static int soc_dts_enable(int id) static void remove_dts_thermal_zone(struct intel_soc_dts_sensor_entry *dts) { - if (dts) { - iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE, - SOC_DTS_OFFSET_ENABLE, dts->store_status); - thermal_zone_device_unregister(dts->tzone); - } + iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE, + SOC_DTS_OFFSET_ENABLE, dts->store_status); + thermal_zone_device_unregister(dts->tzone); } static int add_dts_thermal_zone(int id, struct intel_soc_dts_sensor_entry *dts,