Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Jan 2018 22:22:21 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328449 - in head/stand: i386/gptboot mips/beri/loader mips/uboot powerpc/kboot uboot/common uboot/lib
Message-ID:  <201801262222.w0QMMLnt037996@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Fri Jan 26 22:22:21 2018
New Revision: 328449
URL: https://svnweb.freebsd.org/changeset/base/328449

Log:
  Tag unreachable places as such. I left the while (1); in place since
  in this context we want to busy wait to stop.
  
  Suggested by: pfg@

Modified:
  head/stand/i386/gptboot/gptboot.c
  head/stand/mips/beri/loader/main.c
  head/stand/mips/uboot/conf.c
  head/stand/powerpc/kboot/main.c
  head/stand/uboot/common/main.c
  head/stand/uboot/lib/glue.c

Modified: head/stand/i386/gptboot/gptboot.c
==============================================================================
--- head/stand/i386/gptboot/gptboot.c	Fri Jan 26 21:51:13 2018	(r328448)
+++ head/stand/i386/gptboot/gptboot.c	Fri Jan 26 22:22:21 2018	(r328449)
@@ -365,6 +365,7 @@ void
 exit(int x)
 {
 	while (1);
+	__unreachable();
 }
 
 static void

Modified: head/stand/mips/beri/loader/main.c
==============================================================================
--- head/stand/mips/beri/loader/main.c	Fri Jan 26 21:51:13 2018	(r328448)
+++ head/stand/mips/beri/loader/main.c	Fri Jan 26 22:22:21 2018	(r328449)
@@ -193,6 +193,7 @@ abort(void)
 
 	printf("error: loader abort\n");
 	while (1);
+	__unreachable();
 }
 
 void
@@ -201,6 +202,7 @@ exit(int code)
 
 	printf("error: loader exit\n");
 	while (1);
+	__unreachable();
 }
 
 void
@@ -209,6 +211,7 @@ longjmperror(void)
 
 	printf("error: loader longjmp error\n");
 	while (1);
+	__unreachable();
 }
 
 time_t

Modified: head/stand/mips/uboot/conf.c
==============================================================================
--- head/stand/mips/uboot/conf.c	Fri Jan 26 21:51:13 2018	(r328448)
+++ head/stand/mips/uboot/conf.c	Fri Jan 26 22:22:21 2018	(r328449)
@@ -105,6 +105,7 @@ abort(void)
  
 	printf("error: loader abort\n");
 	while (1);
+	__unreachable();
 }
 
 void
@@ -113,6 +114,7 @@ longjmperror(void)
  
 	printf("error: loader longjmp error\n");
 	while (1);
+	__unreachable();
 }
 
 int debug = 1;

Modified: head/stand/powerpc/kboot/main.c
==============================================================================
--- head/stand/powerpc/kboot/main.c	Fri Jan 26 21:51:13 2018	(r328448)
+++ head/stand/powerpc/kboot/main.c	Fri Jan 26 22:22:21 2018	(r328449)
@@ -131,6 +131,7 @@ void
 exit(int code)
 {
 	while (1); /* XXX: host_exit */
+	__unreachable();
 }
 
 void

Modified: head/stand/uboot/common/main.c
==============================================================================
--- head/stand/uboot/common/main.c	Fri Jan 26 21:51:13 2018	(r328448)
+++ head/stand/uboot/common/main.c	Fri Jan 26 22:22:21 2018	(r328449)
@@ -526,7 +526,8 @@ command_reboot(int argc, char *argv[])
 	ub_reset();
 
 	printf("Reset failed!\n");
-	while(1);
+	while (1);
+	__unreachable();
 }
 
 COMMAND_SET(devinfo, "devinfo", "show U-Boot devices", command_devinfo);

Modified: head/stand/uboot/lib/glue.c
==============================================================================
--- head/stand/uboot/lib/glue.c	Fri Jan 26 21:51:13 2018	(r328448)
+++ head/stand/uboot/lib/glue.c	Fri Jan 26 22:22:21 2018	(r328449)
@@ -187,7 +187,8 @@ ub_reset(void)
 {
 
 	syscall(API_RESET, NULL);
-	while (1);		/* Can't tag syscall as __dead2 */
+	while (1);	/* fallback if API_RESET failed */
+	__unreachable();
 }
 
 static struct mem_region mr[UB_MAX_MR];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801262222.w0QMMLnt037996>