mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
thermal: intel: powerclamp: Simplify duration_get()
Use guard(mutex) and return the result of sysfs_emit() directly to simplify the code. Also use %u to format the unsigned duration. Signed-off-by: Thorsten Blum <blum@kernel.org> Link: https://patch.msgid.link/20260915221548.104852-3-blum@kernel.org Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
bbc68b683d
commit
23b16b5178
|
|
@ -103,13 +103,9 @@ static int duration_set(const char *arg, const struct kernel_param *kp)
|
|||
|
||||
static int duration_get(char *buf, const struct kernel_param *kp)
|
||||
{
|
||||
int ret;
|
||||
guard(mutex)(&powerclamp_lock);
|
||||
|
||||
mutex_lock(&powerclamp_lock);
|
||||
ret = sysfs_emit(buf, "%d\n", duration / 1000);
|
||||
mutex_unlock(&powerclamp_lock);
|
||||
|
||||
return ret;
|
||||
return sysfs_emit(buf, "%u\n", duration / 1000);
|
||||
}
|
||||
|
||||
static const struct kernel_param_ops duration_ops = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user