public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Zhang Rui <rui.zhang@intel.com>,
	Linux PM <linux-pm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH v1 3/3] ACPI: thermal: Drop some redundant code
Date: Tue, 04 Oct 2022 18:32:52 +0200	[thread overview]
Message-ID: <1831358.tdWV9SEqCh@kreacher> (raw)
In-Reply-To: <12068304.O9o76ZdvQC@kreacher>

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Drop some redundant initialization of local variables, a redundant
return statement and a redundant "else" from the ACPI thermal driver.

No functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/thermal.c |   19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

Index: linux-pm/drivers/acpi/thermal.c
===================================================================
--- linux-pm.orig/drivers/acpi/thermal.c
+++ linux-pm/drivers/acpi/thermal.c
@@ -262,7 +262,7 @@ do {	\
 
 static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
 {
-	acpi_status status = AE_OK;
+	acpi_status status;
 	unsigned long long tmp;
 	struct acpi_handle_list devices;
 	int valid = 0;
@@ -620,8 +620,9 @@ static int thermal_get_crit_temp(struct
 					tz->trips.critical.temperature,
 					tz->kelvin_offset);
 		return 0;
-	} else
-		return -EINVAL;
+	}
+
+	return -EINVAL;
 }
 
 static int thermal_get_trend(struct thermal_zone_device *thermal,
@@ -941,7 +942,7 @@ static void acpi_thermal_aml_dependency_
 
 static int acpi_thermal_get_info(struct acpi_thermal *tz)
 {
-	int result = 0;
+	int result;
 
 	if (!tz)
 		return -EINVAL;
@@ -1018,8 +1019,8 @@ static void acpi_thermal_check_fn(struct
 
 static int acpi_thermal_add(struct acpi_device *device)
 {
-	int result = 0;
-	struct acpi_thermal *tz = NULL;
+	struct acpi_thermal *tz;
+	int result;
 
 	if (!device)
 		return -EINVAL;
@@ -1060,7 +1061,7 @@ end:
 
 static int acpi_thermal_remove(struct acpi_device *device)
 {
-	struct acpi_thermal *tz = NULL;
+	struct acpi_thermal *tz;
 
 	if (!device || !acpi_driver_data(device))
 		return -EINVAL;
@@ -1189,7 +1190,7 @@ static const struct dmi_system_id therma
 
 static int __init acpi_thermal_init(void)
 {
-	int result = 0;
+	int result;
 
 	dmi_check_system(thermal_dmi_table);
 
@@ -1216,8 +1217,6 @@ static void __exit acpi_thermal_exit(voi
 {
 	acpi_bus_unregister_driver(&acpi_thermal_driver);
 	destroy_workqueue(acpi_thermal_pm_queue);
-
-	return;
 }
 
 module_init(acpi_thermal_init);




  parent reply	other threads:[~2022-10-04 16:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-04 16:28 [PATCH v1 0/3] ACPI: thermal: Clean up simple things Rafael J. Wysocki
2022-10-04 16:31 ` [PATCH v1 1/3] ACPI: thermal: Use white space more consistently Rafael J. Wysocki
2022-10-05  6:58   ` Daniel Lezcano
2022-10-04 16:32 ` [PATCH v1 2/3] ACPI: thermal: Drop redundant parens from expressions Rafael J. Wysocki
2022-10-05  6:59   ` Daniel Lezcano
2022-10-04 16:32 ` Rafael J. Wysocki [this message]
2022-10-05  7:00   ` [PATCH v1 3/3] ACPI: thermal: Drop some redundant code Daniel Lezcano
2022-10-04 16:45 ` [PATCH v1 0/3] ACPI: thermal: Clean up simple things Daniel Lezcano
2022-10-04 16:46   ` Rafael J. Wysocki
2022-10-04 17:26 ` [PATCH RFC 0/9] ACPI thermal cleanups Daniel Lezcano
2022-10-04 17:26   ` [PATCH RFC 1/9] thermal/acpi: Remove the intermediate acpi_thermal_trip structure Daniel Lezcano
2022-10-04 17:26   ` [PATCH RFC 2/9] thermal/acpi: Change to a common " Daniel Lezcano
2022-10-04 17:26   ` [PATCH RFC 3/9] thermal/acpi: Convert the acpi thermal trips to an array Daniel Lezcano
2022-10-04 17:26   ` [PATCH RFC 4/9] thermal/acpi: Move the active trip points to the same array Daniel Lezcano
2022-10-04 17:26   ` [PATCH RFC 5/9] thermal/acpi: Optimize get_trip_points() Daniel Lezcano
2022-10-04 17:26   ` [PATCH RFC 6/9] thermal/acpi: Encapsualte in functions the trip initialization Daniel Lezcano
2022-10-04 17:26   ` [PATCH RFC 7/9] thermal/acpi: Simplifify the condition check Daniel Lezcano
2022-10-04 17:26   ` [PATCH RFC 8/9] thermal/acpi: Remove active and enabled flags Daniel Lezcano
2022-10-04 17:26   ` [PATCH RFC 9/9] thermal/acpi: Rewrite the trip point intialization to use the generic thermal trip Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1831358.tdWV9SEqCh@kreacher \
    --to=rjw@rjwysocki.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=srinivas.pandruvada@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox