diff mbox

[U-Boot,v3,6/6] sandbox: Drop special case console code for sandbox

Message ID 20170616033754.20963-6-sjg@chromium.org
State Accepted
Commit d8c6fb8cedbc35eee27730a7fa544e499b3c81cc
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass June 16, 2017, 3:37 a.m. UTC
At present sandbox has a special case where it directly calls os_putc()
when it does not have a console yet.

Now that we have the pre-console buffer enabled we can drop this. Any
early characters will be buffered and output later.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Add new patch to drop special case console code for sandbox

Changes in v2: None

 common/console.c | 13 -------------
 1 file changed, 13 deletions(-)

Comments

Bin Meng June 16, 2017, 5:08 a.m. UTC | #1
On Fri, Jun 16, 2017 at 11:37 AM, Simon Glass <sjg@chromium.org> wrote:
> At present sandbox has a special case where it directly calls os_putc()
> when it does not have a console yet.
>
> Now that we have the pre-console buffer enabled we can drop this. Any
> early characters will be buffered and output later.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v3:
> - Add new patch to drop special case console code for sandbox
>
> Changes in v2: None
>
>  common/console.c | 13 -------------
>  1 file changed, 13 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass July 6, 2017, 2:51 p.m. UTC | #2
On Fri, Jun 16, 2017 at 11:37 AM, Simon Glass <sjg@chromium.org> wrote:
> At present sandbox has a special case where it directly calls os_putc()
> when it does not have a console yet.
>
> Now that we have the pre-console buffer enabled we can drop this. Any
> early characters will be buffered and output later.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v3:
> - Add new patch to drop special case console code for sandbox
>
> Changes in v2: None
>
>  common/console.c | 13 -------------
>  1 file changed, 13 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Applied to u-boot-dm, thanks!
diff mbox

Patch

diff --git a/common/console.c b/common/console.c
index 762d5f291c..c6156f33bb 100644
--- a/common/console.c
+++ b/common/console.c
@@ -465,13 +465,6 @@  static inline void print_pre_console_buffer(int flushpoint) {}
 
 void putc(const char c)
 {
-#ifdef CONFIG_SANDBOX
-	/* sandbox can send characters to stdout before it has a console */
-	if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) {
-		os_putc(c);
-		return;
-	}
-#endif
 #ifdef CONFIG_DEBUG_UART
 	/* if we don't have a console yet, use the debug UART */
 	if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) {
@@ -508,12 +501,6 @@  void putc(const char c)
 
 void puts(const char *s)
 {
-#ifdef CONFIG_SANDBOX
-	if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) {
-		os_puts(s);
-		return;
-	}
-#endif
 #ifdef CONFIG_DEBUG_UART
 	if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) {
 		while (*s) {