public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/6] stdio: dm: Make stdio_devices[] local
Date: Sat, 1 Sep 2012 22:14:45 +0200	[thread overview]
Message-ID: <201209012214.45559.marex@denx.de> (raw)
In-Reply-To: <1346453055-30888-4-git-send-email-marex@denx.de>

Dear Marek Vasut,

> Use stdio_get_fd() and stdio_set_fd() instead of direct access
> to the array. This allows making stdio_devices[] local to stdio.c
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Wolfgang Denk <wd@denx.de>

[...]

> @@ -622,6 +635,7 @@ int console_init_r(void)
>  {
>  	char *stdinname, *stdoutname, *stderrname;
>  	struct stdio_dev *inputdev = NULL, *outputdev = NULL, *errdev = NULL;
> +	struct stdio_dev *sio;

Self-review: NAK! This generates a warning.

Self-reply: V2 on the way.

>  #ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
>  	int i;
>  #endif /* CONFIG_SYS_CONSOLE_ENV_OVERWRITE */
> @@ -690,7 +704,9 @@ done:
>  #ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
>  	/* set the environment variables (will overwrite previous env settings)
> */ for (i = 0; i < 3; i++) {
> -		setenv(stdio_names[i], stdio_devices[i]->name);
> +		sio = stdio_get_fd(i);
> +		if (sio)
> +			setenv(stdio_names[i], sio->name);
>  	}
>  #endif /* CONFIG_SYS_CONSOLE_ENV_OVERWRITE */
> 

[...]

Best regards,

  reply	other threads:[~2012-09-01 20:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-31 22:44 [U-Boot] [PATCH 0/6] stdio: Clean up Marek Vasut
2012-08-31 22:44 ` [U-Boot] [PATCH 1/6] stdio: dm: Remove dead code in console.c Marek Vasut
2012-08-31 22:44 ` [U-Boot] [PATCH 2/6] stdio: dm: Add accessors to stdio_devices[] Marek Vasut
2012-08-31 22:44 ` [U-Boot] [PATCH 3/6] stdio: dm: Make stdio_devices[] local Marek Vasut
2012-09-01 20:14   ` Marek Vasut [this message]
2012-09-01 23:11   ` Andreas Bießmann
2012-09-02  0:02     ` Marek Vasut
2012-09-02  8:12       ` Wolfgang Denk
2012-08-31 22:44 ` [U-Boot] [PATCH 4/6] stdio: dm: Add stdio_fd_to_name() call Marek Vasut
2012-08-31 22:44 ` [U-Boot] [PATCH 5/6] stdio: dm: Use stdio_fd_to_name() call to localize stdio_names Marek Vasut
2012-08-31 22:44 ` [U-Boot] [PATCH 6/6] stdio: dm: Optimize stdio_print_current_devices() Marek Vasut
2012-09-01 12:17 ` [U-Boot] [PATCH 0/6] stdio: Clean up Wolfgang Denk
2012-09-01 14:19   ` Marek Vasut
2012-09-01 16:33     ` Wolfgang Denk
2012-09-01 16:57       ` Marek Vasut
2012-09-01 20:00         ` Wolfgang Denk
2012-09-01 20:12           ` Marek Vasut

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=201209012214.45559.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /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