diff options
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 9 | ||||
-rw-r--r-- | drivers/thermal/intel/intel_powerclamp.c | 8 |
2 files changed, 7 insertions, 10 deletions
diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index 19926beeb3b7..8502b7d8df89 100644 --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -129,11 +129,10 @@ static ssize_t available_uuids_show(struct device *dev, for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; i++) { if (priv->uuid_bitmap & (1 << i)) - if (PAGE_SIZE - length > 0) - length += scnprintf(&buf[length], - PAGE_SIZE - length, - "%s\n", - int3400_thermal_uuids[i]); + length += scnprintf(&buf[length], + PAGE_SIZE - length, + "%s\n", + int3400_thermal_uuids[i]); } return length; diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c index a5b58ea89cc6..9b68489a2356 100644 --- a/drivers/thermal/intel/intel_powerclamp.c +++ b/drivers/thermal/intel/intel_powerclamp.c @@ -705,10 +705,8 @@ static enum cpuhp_state hp_state; static int __init powerclamp_init(void) { int retval; - int bitmap_size; - bitmap_size = BITS_TO_LONGS(num_possible_cpus()) * sizeof(long); - cpu_clamping_mask = kzalloc(bitmap_size, GFP_KERNEL); + cpu_clamping_mask = bitmap_zalloc(num_possible_cpus(), GFP_KERNEL); if (!cpu_clamping_mask) return -ENOMEM; @@ -753,7 +751,7 @@ exit_free_thread: exit_unregister: cpuhp_remove_state_nocalls(hp_state); exit_free: - kfree(cpu_clamping_mask); + bitmap_free(cpu_clamping_mask); return retval; } module_init(powerclamp_init); @@ -764,7 +762,7 @@ static void __exit powerclamp_exit(void) cpuhp_remove_state_nocalls(hp_state); free_percpu(worker_data); thermal_cooling_device_unregister(cooling_dev); - kfree(cpu_clamping_mask); + bitmap_free(cpu_clamping_mask); cancel_delayed_work_sync(&poll_pkg_cstate_work); debugfs_remove_recursive(debug_dir); |