[Skiboot] [PATCH 04/10] device: Change aborts to asserts

Ananth N Mavinakayanahalli ananth at in.ibm.com
Wed Feb 11 02:15:06 AEDT 2015


... so we get good debug data on TI

Signed-off-by: Ananth N Mavinakayanahalli <ananth at in.ibm.com>
---
 core/device.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/core/device.c b/core/device.c
index 51ddbdb..5478bb5 100644
--- a/core/device.c
+++ b/core/device.c
@@ -32,7 +32,7 @@ static const char *take_name(const char *name)
 {
 	if (!is_rodata(name) && !(name = strdup(name))) {
 		prerror("Failed to allocate copy of name");
-		abort();
+		assert(false);
 	}
 	return name;
 }
@@ -48,7 +48,7 @@ static struct dt_node *new_node(const char *name)
 	struct dt_node *node = malloc(sizeof *node);
 	if (!node) {
 		prerror("Failed to allocate node\n");
-		abort();
+		assert(node);
 	}
 
 	node->name = take_name(name);
@@ -267,12 +267,12 @@ static struct dt_property *new_property(struct dt_node *node,
 	if (!p) {
 		prerror("Failed to allocate property \"%s\" for %s of %zu bytes\n",
 			name, dt_get_path(node), size);
-		abort();
+		assert(p);
 	}
 	if (dt_find_property(node, name)) {
 		prerror("Duplicate property \"%s\" in node %s\n",
 			name, dt_get_path(node));
-		abort();
+		assert(false);
 
 	}
 
@@ -697,7 +697,7 @@ void dt_expand(const void *fdt)
 	dt_root = dt_new_root("");
 
 	if (dt_expand_node(dt_root, fdt, 0) < 0)
-		abort();
+		assert(false);
 }
 
 u64 dt_get_number(const void *pdata, unsigned int cells)



More information about the Skiboot mailing list