Skip to content

Commit 36f5540

Browse files
committed
ACPI: thermal: Drop some redundant code
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 <[email protected]> Acked-by: Daniel Lezcano <[email protected]>
1 parent 9e8bc16 commit 36f5540

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

drivers/acpi/thermal.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ do { \
262262

263263
static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
264264
{
265-
acpi_status status = AE_OK;
265+
acpi_status status;
266266
unsigned long long tmp;
267267
struct acpi_handle_list devices;
268268
int valid = 0;
@@ -620,8 +620,9 @@ static int thermal_get_crit_temp(struct thermal_zone_device *thermal,
620620
tz->trips.critical.temperature,
621621
tz->kelvin_offset);
622622
return 0;
623-
} else
624-
return -EINVAL;
623+
}
624+
625+
return -EINVAL;
625626
}
626627

627628
static int thermal_get_trend(struct thermal_zone_device *thermal,
@@ -941,7 +942,7 @@ static void acpi_thermal_aml_dependency_fix(struct acpi_thermal *tz)
941942

942943
static int acpi_thermal_get_info(struct acpi_thermal *tz)
943944
{
944-
int result = 0;
945+
int result;
945946

946947
if (!tz)
947948
return -EINVAL;
@@ -1018,8 +1019,8 @@ static void acpi_thermal_check_fn(struct work_struct *work)
10181019

10191020
static int acpi_thermal_add(struct acpi_device *device)
10201021
{
1021-
int result = 0;
1022-
struct acpi_thermal *tz = NULL;
1022+
struct acpi_thermal *tz;
1023+
int result;
10231024

10241025
if (!device)
10251026
return -EINVAL;
@@ -1060,7 +1061,7 @@ static int acpi_thermal_add(struct acpi_device *device)
10601061

10611062
static int acpi_thermal_remove(struct acpi_device *device)
10621063
{
1063-
struct acpi_thermal *tz = NULL;
1064+
struct acpi_thermal *tz;
10641065

10651066
if (!device || !acpi_driver_data(device))
10661067
return -EINVAL;
@@ -1189,7 +1190,7 @@ static const struct dmi_system_id thermal_dmi_table[] __initconst = {
11891190

11901191
static int __init acpi_thermal_init(void)
11911192
{
1192-
int result = 0;
1193+
int result;
11931194

11941195
dmi_check_system(thermal_dmi_table);
11951196

@@ -1216,8 +1217,6 @@ static void __exit acpi_thermal_exit(void)
12161217
{
12171218
acpi_bus_unregister_driver(&acpi_thermal_driver);
12181219
destroy_workqueue(acpi_thermal_pm_queue);
1219-
1220-
return;
12211220
}
12221221

12231222
module_init(acpi_thermal_init);

0 commit comments

Comments
 (0)