Don't return error information from console_flush

And from crash_console_flush.

We ignore the error information return by console_flush in _every_
place where we call it, and casting the return type to void does not
work around the MISRA violation that this causes. Instead, we collect
the error information from the driver (to avoid changing that API), and
don't return it to the caller.

Change-Id: I1e35afe01764d5c8f0efd04f8949d333ffb688c1
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
diff --git a/drivers/console/aarch32/skeleton_console.S b/drivers/console/aarch32/skeleton_console.S
index c594f7e..a9e13ec 100644
--- a/drivers/console/aarch32/skeleton_console.S
+++ b/drivers/console/aarch32/skeleton_console.S
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2020, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -149,7 +149,7 @@
 	 * Function to force a write of all buffered
 	 * data that hasn't been output.
 	 * In : r0 - pointer to console_xxx_t struct
-	 * Out: r0 - 0 on success, < 0 on error
+	 * Out: void
 	 * Clobber list : r0, r1, r2, r3, r4, r5
 	 * ---------------------------------------------
 	 */
@@ -166,11 +166,5 @@
 	 * all data has been flushed or there was an unrecoverable error.
 	 */
 
-	mov	r0, #0
-	bx	lr
-
-	/* Jump here if an unrecoverable error has been encountered. */
-flush_error:
-	mov	r0, #-1
 	bx	lr
 endfunc console_xxx_flush
diff --git a/drivers/console/aarch64/skeleton_console.S b/drivers/console/aarch64/skeleton_console.S
index 9a85867..7ea2eec 100644
--- a/drivers/console/aarch64/skeleton_console.S
+++ b/drivers/console/aarch64/skeleton_console.S
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -145,11 +145,11 @@
 endfunc console_xxx_getc
 
 	/* ---------------------------------------------
-	 * int console_xxx_flush(console_xxx_t *console)
+	 * void console_xxx_flush(console_xxx_t *console)
 	 * Function to force a write of all buffered
 	 * data that hasn't been output.
 	 * In : x0 - pointer to console_xxx_t struct
-	 * Out: w0 - 0 on success, < 0 on error
+	 * Out: void
 	 * Clobber list : x0, x1, x2, x3, x4, x5
 	 * ---------------------------------------------
 	 */
@@ -166,11 +166,5 @@
 	 * all data has been flushed or there was an unrecoverable error.
 	 */
 
-	mov	w0, #0
-	ret
-
-	/* Jump here if an unrecoverable error has been encountered. */
-flush_error:
-	mov	w0, #-1
 	ret
 endfunc console_xxx_flush
diff --git a/drivers/console/multi_console.c b/drivers/console/multi_console.c
index 0665f20..08b8e9f 100644
--- a/drivers/console/multi_console.c
+++ b/drivers/console/multi_console.c
@@ -119,17 +119,12 @@
 	return err;
 }
 
-int console_flush(void)
+void console_flush(void)
 {
-	int err = ERROR_NO_VALID_CONSOLE;
 	console_t *console;
 
 	for (console = console_list; console != NULL; console = console->next)
 		if ((console->flags & console_state) && (console->flush != NULL)) {
-			int ret = console->flush(console);
-			if ((err == ERROR_NO_VALID_CONSOLE) || (ret < err))
-				err = ret;
+			console->flush(console);
 		}
-
-	return err;
 }