diff mbox

[Resend] PM: Remove unnecessary !!

Message ID 40f994376d56b4fa090fc2d27403c2188a4af0a4.1394460079.git.viresh.kumar@linaro.org
State New
Headers show

Commit Message

Viresh Kumar March 10, 2014, 2:01 p.m. UTC
Double ! or !! are normally required to get 0 or 1 out of a expression. A
comparision always returns 0 or 1 and hence there is no need to apply double !
over it again.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 kernel/power/suspend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rafael J. Wysocki March 11, 2014, 1:02 a.m. UTC | #1
On Monday, March 10, 2014 07:31:51 PM Viresh Kumar wrote:
> Double ! or !! are normally required to get 0 or 1 out of a expression. A
> comparision always returns 0 or 1 and hence there is no need to apply double !
> over it again.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Queued up for 3.15, thanks!

> ---
>  kernel/power/suspend.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
> index 62ee437..90b3d93 100644
> --- a/kernel/power/suspend.c
> +++ b/kernel/power/suspend.c
> @@ -39,7 +39,7 @@ static const struct platform_suspend_ops *suspend_ops;
>  
>  static bool need_suspend_ops(suspend_state_t state)
>  {
> -	return !!(state > PM_SUSPEND_FREEZE);
> +	return state > PM_SUSPEND_FREEZE;
>  }
>  
>  static DECLARE_WAIT_QUEUE_HEAD(suspend_freeze_wait_head);
>
diff mbox

Patch

diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 62ee437..90b3d93 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -39,7 +39,7 @@  static const struct platform_suspend_ops *suspend_ops;
 
 static bool need_suspend_ops(suspend_state_t state)
 {
-	return !!(state > PM_SUSPEND_FREEZE);
+	return state > PM_SUSPEND_FREEZE;
 }
 
 static DECLARE_WAIT_QUEUE_HEAD(suspend_freeze_wait_head);