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: <4ad61875-f694-58a6-f5d8-fca52c093c1d@linux.com>
Date:   Thu, 29 Aug 2019 00:13:45 +0300
From:   Denis Efremov <efremov@...ux.com>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org
Subject: Re: [PATCH] asm-generic: add unlikely to default BUG_ON(x)

Maybe it will be better to move this define out of ifdef, i.e.:

#ifdef CONFIG_BUG
...
-#define BUG_ON()...
...
#else
...
-#define BUG_ON()...
...
#endif

+#define BUG_ON()...

I can prepare a patch if you think it worth it.

Thanks,
Denis

On 29.08.2019 00:09, Denis Efremov wrote:
> Add unlikely to default BUG_ON(x) in !CONFIG_BUG. It makes
> the define consistent with BUG_ON(x) in CONFIG_BUG.
> 
> Signed-off-by: Denis Efremov <efremov@...ux.com>
> Cc: Arnd Bergmann <arnd@...db.de>
> Cc: <linux-arch@...r.kernel.org>
> ---
>  include/asm-generic/bug.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
> index aa6c093d9ce9..7357a3c942a0 100644
> --- a/include/asm-generic/bug.h
> +++ b/include/asm-generic/bug.h
> @@ -185,7 +185,7 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
>  #endif
>  
>  #ifndef HAVE_ARCH_BUG_ON
> -#define BUG_ON(condition) do { if (condition) BUG(); } while (0)
> +#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
>  #endif
>  
>  #ifndef HAVE_ARCH_WARN_ON
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ