mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
cpuidle: Avoid assignment in if () argument
Clean up cpuidle_enable_device() to avoid doing an assignment in an expression evaluated as an argument of if (), which also makes the code in question more readable. Signed-off-by: Gaurav Jindal <gauravjindal1104@gmail.com> [ rjw: Subject & changelog ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
e7b06a09e7
commit
3fc74bd8a7
@ -403,9 +403,11 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (cpuidle_curr_governor->enable &&
|
||||
(ret = cpuidle_curr_governor->enable(drv, dev)))
|
||||
goto fail_sysfs;
|
||||
if (cpuidle_curr_governor->enable) {
|
||||
ret = cpuidle_curr_governor->enable(drv, dev);
|
||||
if (ret)
|
||||
goto fail_sysfs;
|
||||
}
|
||||
|
||||
smp_wmb();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user