linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel/watchdog: is_hardlockup can be boolean
@ 2015-09-22 13:32 Yaowei Bai
  2015-09-22 14:23 ` Aaron Tomlin
  2015-09-22 15:53 ` Don Zickus
  0 siblings, 2 replies; 3+ messages in thread
From: Yaowei Bai @ 2015-09-22 13:32 UTC (permalink / raw)
  To: akpm, uobergfe, dzickus, atomlin, cmetcalf, fweisbec, eranian
  Cc: linux-kernel

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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] kernel/watchdog: is_hardlockup can be boolean
  2015-09-22 13:32 [PATCH] kernel/watchdog: is_hardlockup can be boolean Yaowei Bai
@ 2015-09-22 14:23 ` Aaron Tomlin
  2015-09-22 15:53 ` Don Zickus
  1 sibling, 0 replies; 3+ messages in thread
From: Aaron Tomlin @ 2015-09-22 14:23 UTC (permalink / raw)
  To: Yaowei Bai
  Cc: akpm, uobergfe, dzickus, cmetcalf, fweisbec, eranian,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1129 bytes --]

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>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kernel/watchdog: is_hardlockup can be boolean
  2015-09-22 13:32 [PATCH] kernel/watchdog: is_hardlockup can be boolean Yaowei Bai
  2015-09-22 14:23 ` Aaron Tomlin
@ 2015-09-22 15:53 ` Don Zickus
  1 sibling, 0 replies; 3+ messages in thread
From: Don Zickus @ 2015-09-22 15:53 UTC (permalink / raw)
  To: Yaowei Bai
  Cc: akpm, uobergfe, atomlin, cmetcalf, fweisbec, eranian,
	linux-kernel

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
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-22 15:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-22 13:32 [PATCH] kernel/watchdog: is_hardlockup can be boolean Yaowei Bai
2015-09-22 14:23 ` Aaron Tomlin
2015-09-22 15:53 ` Don Zickus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).