mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexey Galakhov <agalakhov@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] fix console fifo (and loadb/loady commands)
Date: Mon, 16 May 2011 08:30:18 +0200	[thread overview]
Message-ID: <20110516063018.GC30963@pengutronix.de> (raw)
In-Reply-To: <4DCD37D9.5020408@gmail.com>

Hi Alexey,

On Fri, May 13, 2011 at 07:53:29PM +0600, Alexey Galakhov wrote:
> This patch fixes loadb and loady commands. tstc() should return true if
> console_input_buffer is not empty.

The patch is fine, thanks.

Your mailer converts tabs into whitespaces. Also you forgot to add a
signed-off-by to your patch. I fixed this up manually this time.

Sascha

> 
> diff -udp ./common/console.c.orig ./common/console.c
> --- ./common/console.c.orig    2011-05-06 13:30:20.000000000 +0600
> +++ ./common/console.c    2011-05-13 19:42:12.000000000 +0600
> @@ -195,6 +195,20 @@ static int getc_raw(void)
>      }
>  }
>  
> +static int tstc_raw(void)
> +{
> +    struct console_device *cdev;
> +
> +    for_each_console(cdev) {
> +        if (!(cdev->f_active & CONSOLE_STDIN))
> +            continue;
> +        if (cdev->tstc(cdev))
> +            return 1;
> +    }
> +
> +    return 0;
> +}
> +
>  int getc(void)
>  {
>      unsigned char ch;
> @@ -209,7 +223,7 @@ int getc(void)
>      while (1) {
>          poller_call();
>  
> -        if (tstc()) {
> +        if (tstc_raw()) {
>              kfifo_putc(console_input_buffer, getc_raw());
>  
>              start = get_time_ns();
> @@ -236,16 +250,7 @@ EXPORT_SYMBOL(fgetc);
>  
>  int tstc(void)
>  {
> -    struct console_device *cdev;
> -
> -    for_each_console(cdev) {
> -        if (!(cdev->f_active & CONSOLE_STDIN))
> -            continue;
> -        if (cdev->tstc(cdev))
> -            return 1;
> -    }
> -
> -    return 0;
> +    return kfifo_len(console_input_buffer) || tstc_raw();
>  }
>  EXPORT_SYMBOL(tstc);
>  
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2011-05-16  6:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-13 13:31 loadb and loady do not work Alexey Galakhov
2011-05-13 13:53 ` [PATCH] fix console fifo (and loadb/loady commands) Alexey Galakhov
2011-05-16  6:30   ` Sascha Hauer [this message]
2011-05-16  6:53     ` Alexey Galakhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110516063018.GC30963@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=agalakhov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox