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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 6 Aug 2014 22:10:20 -0700
From:	Josh Triplett <josh@...htriplett.org>
To:	Nick Krause <xerofoiify@...il.com>
Cc:	Magnus Damm <magnus.damm@...il.com>,
	Geert Uytterhoeven <geert+renesas@...der.be>,
	Simon Horman <horms+renesas@...ge.net.au>,
	"open list:SUPERH" <linux-sh@...r.kernel.org>,
	open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] sh: bug: add unreachable() to silence warnings

On Thu, Aug 07, 2014 at 03:42:20AM +0200, Nick Krause wrote:
> SuperH BUG() have warnings like
> 
> kernel/sched/core.c:2692:1: warning: control reaches end of non-void function
> [-Wreturn-type]
> net/core/ethtool.c:236:1: warning: control reaches end of non-void function
> [-Wreturn-type]
> 
> Other BUG() implementations
> have added unreachable() at end becuase of which I guess
> it does not showthese errors. We can silence them using unreachable().
> 
> Signed-off-by: Nick Krause <xerofoify@...il.com>

This change seems reasonable to me.  Unlike the generic version of
BUG(), this one doesn't call panic() or anything else flagged as
__noreturn, so it seems reasonable to add a call to unreachable() here
to tell the compiler that the assembly will trap and not return.

Reviewed-by: Josh Triplett <josh@...htriplett.org>

>  arch/sh/include/asm/bug.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/sh/include/asm/bug.h b/arch/sh/include/asm/bug.h
> index dcf2780..1ae948f 100644
> --- a/arch/sh/include/asm/bug.h
> +++ b/arch/sh/include/asm/bug.h
> @@ -48,6 +48,7 @@ do {							\
>  		   "i" (__FILE__),			\
>  		   "i" (__LINE__), "i" (0),		\
>  		   "i" (sizeof(struct bug_entry)));	\
> +	unreachable();					\
>  } while (0)
>  
>  #define __WARN_TAINT(taint)				\
> -- 
> 2.0.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists