[3/4] linux-generic: tm: use odp_abort instead of abort

Message ID 1464948753-942-4-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov June 3, 2016, 10:12 a.m.
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 platform/linux-generic/odp_name_table.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

Patch

diff --git a/platform/linux-generic/odp_name_table.c b/platform/linux-generic/odp_name_table.c
index 690cf7a..4d7fba2 100644
--- a/platform/linux-generic/odp_name_table.c
+++ b/platform/linux-generic/odp_name_table.c
@@ -184,12 +184,9 @@  static void check_secondary_hash(secondary_hash_tbl_t *secondary_hash_tbl)
 		tbn1           = hash_tbl_entry & ~0x3F;
 
 		if (hash_tbl_entry != 0) {
-			if ((hash_tbl_entry >> 48) == 0x7FFF)
-				;
-			else if ((hash_tbl_entry >> 48) == 0)
-				;
-			else
-				abort();
+			if (!((hash_tbl_entry >> 48) == 0x7FFF) ||
+			    ((hash_tbl_entry >> 48) == 0))
+				ODP_ABORT("hash_tbl_entry error\n");
 
 			for (idx2 = 0; idx2 < idx; idx2++) {
 				hash_tbl_entry2 =
@@ -197,7 +194,7 @@  static void check_secondary_hash(secondary_hash_tbl_t *secondary_hash_tbl)
 				if (hash_tbl_entry2 != 0) {
 					tbn2 = hash_tbl_entry2 & ~0x3F;
 					if (tbn1 == tbn2)
-						abort();
+						ODP_ABORT("tbn1 == tbn2\n");
 				}
 			}
 		}
@@ -753,7 +750,7 @@  static int name_hash_tbl_delete(name_tbl_entry_t *entry_to_delete,
 						entry_to_delete, entry_cnt);
 		tbn = (*hash_entry_ptr) & ~0x3F;
 		if (tbn == 0xFFFFFFFFFFFFFFC0)
-			abort();
+			ODP_ABORT("tbn overflow\n");
 
 		if (rc < 0)
 			return rc;
@@ -787,7 +784,7 @@  static int name_hash_tbl_delete(name_tbl_entry_t *entry_to_delete,
 						entry_to_delete, entry_cnt);
 		tbn = (*hash_entry_ptr) & ~0x3F;
 		if (tbn == 0xFFFFFFFFFFFFFFC0)
-			abort();
+			ODP_ABORT("tbn overflow\n");
 
 		check_secondary_hash(secondary_hash);
 		if (rc < 0)
@@ -836,7 +833,7 @@  static int name_hash_tbl_delete(name_tbl_entry_t *entry_to_delete,
 						entry_to_delete, entry_cnt);
 		tbn = (*hash_entry_ptr) & ~0x3F;
 		if (tbn == 0xFFFFFFFFFFFFFFC0)
-			abort();
+			ODP_ABORT("tbn overflow\n");
 
 		check_secondary_hash(secondary_hash);
 		if (rc < 0)