lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150922142325.GB25024@atomlin.usersys.redhat.com>
Date:	Tue, 22 Sep 2015 15:23:25 +0100
From:	Aaron Tomlin <atomlin@...hat.com>
To:	Yaowei Bai <bywxiaobai@....com>
Cc:	akpm@...ux-foundation.org, uobergfe@...hat.com, dzickus@...hat.com,
	cmetcalf@...hip.com, fweisbec@...il.com, eranian@...gle.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kernel/watchdog: is_hardlockup can be boolean

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@....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@...hat.com>

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ