Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1230221 > unrolled thread

[PATCH] kernel/watchdog: is_hardlockup can be boolean

Started byYaowei Bai <bywxiaobai@163.com>
First post2015-09-22 15:50 +0200
Last post2015-09-22 18:00 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] kernel/watchdog: is_hardlockup can be boolean Yaowei Bai <bywxiaobai@163.com> - 2015-09-22 15:50 +0200
    Re: [PATCH] kernel/watchdog: is_hardlockup can be boolean Aaron Tomlin <atomlin@redhat.com> - 2015-09-22 16:30 +0200
    Re: [PATCH] kernel/watchdog: is_hardlockup can be boolean Don Zickus <dzickus@redhat.com> - 2015-09-22 18:00 +0200

#1230221 — [PATCH] kernel/watchdog: is_hardlockup can be boolean

FromYaowei Bai <bywxiaobai@163.com>
Date2015-09-22 15:50 +0200
Subject[PATCH] kernel/watchdog: is_hardlockup can be boolean
Message-ID<qbw7g-6Xg-21@gated-at.bofh.it>
This patch makes is_hardlockup return bool to improve readability
due to this particular function only using either one or zero as its
return value.

No functional change.

Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
---
 kernel/watchdog.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 64ed1c3..568ba64 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -263,15 +263,15 @@ void touch_softlockup_watchdog_sync(void)
 
 #ifdef CONFIG_HARDLOCKUP_DETECTOR
 /* watchdog detector functions */
-static int is_hardlockup(void)
+static bool is_hardlockup(void)
 {
 	unsigned long hrint = __this_cpu_read(hrtimer_interrupts);
 
 	if (__this_cpu_read(hrtimer_interrupts_saved) == hrint)
-		return 1;
+		return true;
 
 	__this_cpu_write(hrtimer_interrupts_saved, hrint);
-	return 0;
+	return false;
 }
 #endif
 
-- 
1.9.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1230261

FromAaron Tomlin <atomlin@redhat.com>
Date2015-09-22 16:30 +0200
Message-ID<qbwJY-7Vf-7@gated-at.bofh.it>
In reply to#1230221

[Multipart message — attachments visible in raw view] — view raw

On Tue 2015-09-22 21:32 +0800, Yaowei Bai wrote:
> This patch makes is_hardlockup return bool to improve readability
> due to this particular function only using either one or zero as its
> return value.
> 
> No functional change.
> 
> Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
> ---
>  kernel/watchdog.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> index 64ed1c3..568ba64 100644
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -263,15 +263,15 @@ void touch_softlockup_watchdog_sync(void)
>  
>  #ifdef CONFIG_HARDLOCKUP_DETECTOR
>  /* watchdog detector functions */
> -static int is_hardlockup(void)
> +static bool is_hardlockup(void)
>  {
>  	unsigned long hrint = __this_cpu_read(hrtimer_interrupts);
>  
>  	if (__this_cpu_read(hrtimer_interrupts_saved) == hrint)
> -		return 1;
> +		return true;
>  
>  	__this_cpu_write(hrtimer_interrupts_saved, hrint);
> -	return 0;
> +	return false;
>  }
>  #endif
>  

Fair enough with regards to readability.

Reviewed-by: Aaron Tomlin <atomlin@redhat.com>

[toc] | [prev] | [next] | [standalone]


#1230378

FromDon Zickus <dzickus@redhat.com>
Date2015-09-22 18:00 +0200
Message-ID<qby94-1o7-17@gated-at.bofh.it>
In reply to#1230221
On Tue, Sep 22, 2015 at 09:32:43PM +0800, Yaowei Bai wrote:
> This patch makes is_hardlockup return bool to improve readability
> due to this particular function only using either one or zero as its
> return value.
> 
> No functional change.

Looks fine.

Acked-by: Don Zickus <dzickus@redhat.com>

> 
> Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
> ---
>  kernel/watchdog.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> index 64ed1c3..568ba64 100644
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -263,15 +263,15 @@ void touch_softlockup_watchdog_sync(void)
>  
>  #ifdef CONFIG_HARDLOCKUP_DETECTOR
>  /* watchdog detector functions */
> -static int is_hardlockup(void)
> +static bool is_hardlockup(void)
>  {
>  	unsigned long hrint = __this_cpu_read(hrtimer_interrupts);
>  
>  	if (__this_cpu_read(hrtimer_interrupts_saved) == hrint)
> -		return 1;
> +		return true;
>  
>  	__this_cpu_write(hrtimer_interrupts_saved, hrint);
> -	return 0;
> +	return false;
>  }
>  #endif
>  
> -- 
> 1.9.1
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web