[U-Boot] [PATCH] panic: add noreturn attribute

Mike Frysinger vapier at gentoo.org
Wed Jun 29 23:58:04 CEST 2011


Since panic() never returns, we should add an appropriate attribute to
let gcc improve optimization around it.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 include/common.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/common.h b/include/common.h
index 1e21b7a..b59079b 100644
--- a/include/common.h
+++ b/include/common.h
@@ -651,7 +651,7 @@ int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
 unsigned long long	simple_strtoull(const char *cp,char **endp,unsigned int base);
 long	simple_strtol(const char *cp,char **endp,unsigned int base);
 void	panic(const char *fmt, ...)
-		__attribute__ ((format (__printf__, 1, 2)));
+		__attribute__ ((format (__printf__, 1, 2), noreturn));
 int	sprintf(char * buf, const char *fmt, ...)
 		__attribute__ ((format (__printf__, 2, 3)));
 int	vsprintf(char *buf, const char *fmt, va_list args);
-- 
1.7.6



More information about the U-Boot mailing list