Commit da5e562f authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Daniel Lezcano

thermal/drivers/intel/intel_soc_dts_iosf: Switch to use find_first_zero_bit()

Switch to use find_first_zero_bit() instead of open-coded variant.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210618153451.89246-1-andriy.shevchenko@linux.intel.com
parent 481bd297
...@@ -350,13 +350,14 @@ int intel_soc_dts_iosf_add_read_only_critical_trip( ...@@ -350,13 +350,14 @@ int intel_soc_dts_iosf_add_read_only_critical_trip(
int i, j; int i, j;
for (i = 0; i < SOC_MAX_DTS_SENSORS; ++i) { for (i = 0; i < SOC_MAX_DTS_SENSORS; ++i) {
for (j = 0; j < sensors->soc_dts[i].trip_count; ++j) { struct intel_soc_dts_sensor_entry *entry = &sensors->soc_dts[i];
if (!(sensors->soc_dts[i].trip_mask & BIT(j))) { int temp = sensors->tj_max - critical_offset;
return update_trip_temp(&sensors->soc_dts[i], j, unsigned long count = entry->trip_count;
sensors->tj_max - critical_offset, unsigned long mask = entry->trip_mask;
THERMAL_TRIP_CRITICAL);
} j = find_first_zero_bit(&mask, count);
} if (j < count)
return update_trip_temp(entry, j, temp, THERMAL_TRIP_CRITICAL);
} }
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment