mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +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
1 changed files with 5 additions and 3 deletions
|
@ -403,9 +403,11 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (cpuidle_curr_governor->enable &&
|
if (cpuidle_curr_governor->enable) {
|
||||||
(ret = cpuidle_curr_governor->enable(drv, dev)))
|
ret = cpuidle_curr_governor->enable(drv, dev);
|
||||||
goto fail_sysfs;
|
if (ret)
|
||||||
|
goto fail_sysfs;
|
||||||
|
}
|
||||||
|
|
||||||
smp_wmb();
|
smp_wmb();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue