From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D17A2C352BE for ; Tue, 14 Apr 2020 18:03:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA2132076B for ; Tue, 14 Apr 2020 18:03:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503189AbgDNSB1 (ORCPT ); Tue, 14 Apr 2020 14:01:27 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:46710 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2503178AbgDNSBW (ORCPT ); Tue, 14 Apr 2020 14:01:22 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id C384B2A1BDE From: Andrzej Pietrasiewicz To: linux-pm@vger.kernel.org Cc: Zhang Rui , "Rafael J . Wysocki" , Len Brown , Jiri Pirko , Ido Schimmel , "David S . Miller" , Peter Kaestle , Darren Hart , Andy Shevchenko , Support Opensource , Daniel Lezcano , Amit Kucheria , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Allison Randal , Enrico Weigelt , Gayatri Kammela , Thomas Gleixner , linux-acpi@vger.kernel.org, netdev@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, Andrzej Pietrasiewicz Subject: [RFC v2 2/9] thermal: Eliminate an always-false condition Date: Tue, 14 Apr 2020 20:00:58 +0200 Message-Id: <20200414180105.20042-3-andrzej.p@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200414180105.20042-1-andrzej.p@collabora.com> References: <2bc5a902-acde-526a-11a5-2357d899916c@linaro.org> <20200414180105.20042-1-andrzej.p@collabora.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org This driver provides a non-NULL "devdata" argument for thermal_zone_device_register(). Thermal core never sets it to NULL afterwards, so checking for its being NULL in this driver makes no sense. Signed-off-by: Andrzej Pietrasiewicz --- drivers/acpi/thermal.c | 6 ------ drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 6 ------ 2 files changed, 12 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 19067a5e5293..328b479ce7f6 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -531,9 +531,6 @@ static int thermal_get_mode(struct thermal_zone_device *thermal, { struct acpi_thermal *tz = thermal->devdata; - if (!tz) - return -EINVAL; - *mode = tz->tz_enabled ? THERMAL_DEVICE_ENABLED : THERMAL_DEVICE_DISABLED; @@ -546,9 +543,6 @@ static int thermal_set_mode(struct thermal_zone_device *thermal, struct acpi_thermal *tz = thermal->devdata; int enable; - if (!tz) - return -EINVAL; - /* * enable/disable thermal management from ACPI thermal driver */ diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index e802922a13cf..fbb59dd09481 100644 --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -235,9 +235,6 @@ static int int3400_thermal_get_mode(struct thermal_zone_device *thermal, { struct int3400_thermal_priv *priv = thermal->devdata; - if (!priv) - return -EINVAL; - *mode = priv->mode; return 0; @@ -250,9 +247,6 @@ static int int3400_thermal_set_mode(struct thermal_zone_device *thermal, bool enable; int result = 0; - if (!priv) - return -EINVAL; - if (mode == THERMAL_DEVICE_ENABLED) enable = true; else if (mode == THERMAL_DEVICE_DISABLED) -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrzej Pietrasiewicz Subject: [RFC v2 2/9] thermal: Eliminate an always-false condition Date: Tue, 14 Apr 2020 20:00:58 +0200 Message-ID: <20200414180105.20042-3-andrzej.p@collabora.com> References: <2bc5a902-acde-526a-11a5-2357d899916c@linaro.org> <20200414180105.20042-1-andrzej.p@collabora.com> Return-path: In-Reply-To: <20200414180105.20042-1-andrzej.p@collabora.com> Sender: netdev-owner@vger.kernel.org To: linux-pm@vger.kernel.org Cc: Zhang Rui , "Rafael J . Wysocki" , Len Brown , Jiri Pirko , Ido Schimmel , "David S . Miller" , Peter Kaestle , Darren Hart , Andy Shevchenko , Support Opensource , Daniel Lezcano , Amit Kucheria , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Allison Randal , Enrico Weigelt , Gayatri Kammela List-Id: platform-driver-x86.vger.kernel.org This driver provides a non-NULL "devdata" argument for thermal_zone_device_register(). Thermal core never sets it to NULL afterwards, so checking for its being NULL in this driver makes no sense. Signed-off-by: Andrzej Pietrasiewicz --- drivers/acpi/thermal.c | 6 ------ drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 6 ------ 2 files changed, 12 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 19067a5e5293..328b479ce7f6 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -531,9 +531,6 @@ static int thermal_get_mode(struct thermal_zone_device *thermal, { struct acpi_thermal *tz = thermal->devdata; - if (!tz) - return -EINVAL; - *mode = tz->tz_enabled ? THERMAL_DEVICE_ENABLED : THERMAL_DEVICE_DISABLED; @@ -546,9 +543,6 @@ static int thermal_set_mode(struct thermal_zone_device *thermal, struct acpi_thermal *tz = thermal->devdata; int enable; - if (!tz) - return -EINVAL; - /* * enable/disable thermal management from ACPI thermal driver */ diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index e802922a13cf..fbb59dd09481 100644 --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -235,9 +235,6 @@ static int int3400_thermal_get_mode(struct thermal_zone_device *thermal, { struct int3400_thermal_priv *priv = thermal->devdata; - if (!priv) - return -EINVAL; - *mode = priv->mode; return 0; @@ -250,9 +247,6 @@ static int int3400_thermal_set_mode(struct thermal_zone_device *thermal, bool enable; int result = 0; - if (!priv) - return -EINVAL; - if (mode == THERMAL_DEVICE_ENABLED) enable = true; else if (mode == THERMAL_DEVICE_DISABLED) -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45122C2BA19 for ; Tue, 14 Apr 2020 18:01:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A45E720767 for ; Tue, 14 Apr 2020 18:01:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OuS1Wmdp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A45E720767 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=x0H+x2xjPNhqTAOH3c4cW1GPLG54LRIp6OEa5UsHeqc=; b=OuS1Wmdp3seG7vIIGTV6u769AS 5Zdm873tksJsICksab7707axG9siUYfab2KX5cc+N0aTQvXZwReW3pzbWvz6UDUBVcOPJJrAPbmlp uVwNkCWT00DU1CYYrv7CA8Ckfftkf7WvAf2DWplZn6xsPpevhE8L1ZE3sKDfJREacqY8TrDTjCxCm MMdzdr08BZSSHnAt9brlHNQ70DHVeyuuXKBPiv3hU28GSXdzuOJm0p7tiVVipRCc1NMh+gwH21KD3 Whjckrg8tTsEr/mrTSo71FDeH+on4ORhlqe23knDBAazlWSv558TYydCue610MGfGDf+SmnrIIogj 4Il1Zw/A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOPsh-0002fx-CR; Tue, 14 Apr 2020 18:01:55 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOPs9-0002Dn-Kn for linux-arm-kernel@lists.infradead.org; Tue, 14 Apr 2020 18:01:22 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id C384B2A1BDE From: Andrzej Pietrasiewicz To: linux-pm@vger.kernel.org Subject: [RFC v2 2/9] thermal: Eliminate an always-false condition Date: Tue, 14 Apr 2020 20:00:58 +0200 Message-Id: <20200414180105.20042-3-andrzej.p@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200414180105.20042-1-andrzej.p@collabora.com> References: <2bc5a902-acde-526a-11a5-2357d899916c@linaro.org> <20200414180105.20042-1-andrzej.p@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200414_110121_807912_9456F994 X-CRM114-Status: UNSURE ( 8.01 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Rafael J . Wysocki" , platform-driver-x86@vger.kernel.org, kernel@collabora.com, Fabio Estevam , Amit Kucheria , Daniel Lezcano , linux-acpi@vger.kernel.org, NXP Linux Team , Darren Hart , Zhang Rui , Gayatri Kammela , Len Brown , Sascha Hauer , Ido Schimmel , Jiri Pirko , Thomas Gleixner , Allison Randal , linux-arm-kernel@lists.infradead.org, Support Opensource , Shawn Guo , Peter Kaestle , Andrzej Pietrasiewicz , Pengutronix Kernel Team , netdev@vger.kernel.org, Enrico Weigelt , "David S . Miller" , Andy Shevchenko MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org This driver provides a non-NULL "devdata" argument for thermal_zone_device_register(). Thermal core never sets it to NULL afterwards, so checking for its being NULL in this driver makes no sense. Signed-off-by: Andrzej Pietrasiewicz --- drivers/acpi/thermal.c | 6 ------ drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 6 ------ 2 files changed, 12 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 19067a5e5293..328b479ce7f6 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -531,9 +531,6 @@ static int thermal_get_mode(struct thermal_zone_device *thermal, { struct acpi_thermal *tz = thermal->devdata; - if (!tz) - return -EINVAL; - *mode = tz->tz_enabled ? THERMAL_DEVICE_ENABLED : THERMAL_DEVICE_DISABLED; @@ -546,9 +543,6 @@ static int thermal_set_mode(struct thermal_zone_device *thermal, struct acpi_thermal *tz = thermal->devdata; int enable; - if (!tz) - return -EINVAL; - /* * enable/disable thermal management from ACPI thermal driver */ diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index e802922a13cf..fbb59dd09481 100644 --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -235,9 +235,6 @@ static int int3400_thermal_get_mode(struct thermal_zone_device *thermal, { struct int3400_thermal_priv *priv = thermal->devdata; - if (!priv) - return -EINVAL; - *mode = priv->mode; return 0; @@ -250,9 +247,6 @@ static int int3400_thermal_set_mode(struct thermal_zone_device *thermal, bool enable; int result = 0; - if (!priv) - return -EINVAL; - if (mode == THERMAL_DEVICE_ENABLED) enable = true; else if (mode == THERMAL_DEVICE_DISABLED) -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel