linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaron Tomlin <atomlin@redhat.com>
To: Yaowei Bai <bywxiaobai@163.com>
Cc: akpm@linux-foundation.org, uobergfe@redhat.com,
	dzickus@redhat.com, cmetcalf@ezchip.com, fweisbec@gmail.com,
	eranian@google.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernel/watchdog: is_hardlockup can be boolean
Date: Tue, 22 Sep 2015 15:23:25 +0100	[thread overview]
Message-ID: <20150922142325.GB25024@atomlin.usersys.redhat.com> (raw)
In-Reply-To: <1442928763-4425-1-git-send-email-bywxiaobai@163.com>

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

  reply	other threads:[~2015-09-22 14:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22 13:32 [PATCH] kernel/watchdog: is_hardlockup can be boolean Yaowei Bai
2015-09-22 14:23 ` Aaron Tomlin [this message]
2015-09-22 15:53 ` Don Zickus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150922142325.GB25024@atomlin.usersys.redhat.com \
    --to=atomlin@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=bywxiaobai@163.com \
    --cc=cmetcalf@ezchip.com \
    --cc=dzickus@redhat.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=uobergfe@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).