===================================================================
@@ -30,10 +30,10 @@ static int int340x_thermal_get_zone_temp
return conv_temp;
*temp = (unsigned long)conv_temp * 10;
- } else
+ } else {
/* _TMP returns the temperature in tenths of degrees Kelvin */
*temp = deci_kelvin_to_millicelsius(tmp);
-
+ }
return 0;
}
@@ -46,7 +46,7 @@ static int int340x_thermal_set_trip_temp
snprintf(name, sizeof(name), "PAT%d", trip);
status = acpi_execute_simple_method(d->adev->handle, name,
- millicelsius_to_deci_kelvin(temp));
+ millicelsius_to_deci_kelvin(temp));
if (ACPI_FAILURE(status))
return -EIO;
@@ -99,7 +99,6 @@ int int340x_thermal_read_trips(struct in
trip_cnt++;
for (i = 0; i < INT340X_THERMAL_MAX_ACT_TRIP_COUNT; i++) {
-
ret = thermal_acpi_trip_active(int34x_zone->adev, i, &int34x_zone->trips[trip_cnt]);
if (ret)
break;
@@ -125,8 +124,7 @@ struct int34x_thermal_zone *int340x_ther
acpi_status status;
int i, ret;
- int34x_thermal_zone = kzalloc(sizeof(*int34x_thermal_zone),
- GFP_KERNEL);
+ int34x_thermal_zone = kzalloc(sizeof(*int34x_thermal_zone), GFP_KERNEL);
if (!int34x_thermal_zone)
return ERR_PTR(-ENOMEM);
@@ -143,14 +141,15 @@ struct int34x_thermal_zone *int340x_ther
int34x_thermal_zone->ops->get_temp = get_temp;
status = acpi_evaluate_integer(adev->handle, "PATC", NULL, &trip_cnt);
- if (!ACPI_FAILURE(status)) {
+ if (ACPI_SUCCESS(status)) {
int34x_thermal_zone->aux_trip_nr = trip_cnt;
trip_mask = BIT(trip_cnt) - 1;
}
- int34x_thermal_zone->trips = kzalloc(sizeof(*int34x_thermal_zone->trips) *
- (INT340X_THERMAL_MAX_TRIP_COUNT + trip_cnt),
- GFP_KERNEL);
+ trip_cnt += INT340X_THERMAL_MAX_TRIP_COUNT;
+
+ int34x_thermal_zone->trips = kzalloc(sizeof(*int34x_thermal_zone->trips) * trip_cnt,
+ GFP_KERNEL);
if (!int34x_thermal_zone->trips) {
ret = -ENOMEM;
goto err_trips_alloc;
@@ -166,8 +165,7 @@ struct int34x_thermal_zone *int340x_ther
int34x_thermal_zone->trips[i].temperature = THERMAL_TEMP_INVALID;
}
- int34x_thermal_zone->lpat_table = acpi_lpat_get_conversion_table(
- adev->handle);
+ int34x_thermal_zone->lpat_table = acpi_lpat_get_conversion_table(adev->handle);
int34x_thermal_zone->zone = thermal_zone_device_register_with_trips(
acpi_device_bid(adev),