cpuidle: merge two if() statements for checking error cases
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 3 Oct 2013 15:56:47 +0000 (21:26 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 30 Oct 2013 00:21:22 +0000 (01:21 +0100)
Two checks cpuidle_idle_call() cause the same error code to be
returned if they fail, so merge them for clarity.

[rjw: Changelog]
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpuidle/cpuidle.c

index 8c91bad..518b542 100644 (file)
@@ -119,10 +119,7 @@ int cpuidle_idle_call(void)
        struct cpuidle_driver *drv;
        int next_state, entered_state;
 
-       if (off)
-               return -ENODEV;
-
-       if (!initialized)
+       if (off || !initialized)
                return -ENODEV;
 
        /* check if the device is ready */