From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sat, 1 Sep 2012 22:14:45 +0200 Subject: [U-Boot] [PATCH 3/6] stdio: dm: Make stdio_devices[] local In-Reply-To: <1346453055-30888-4-git-send-email-marex@denx.de> References: <1346453055-30888-1-git-send-email-marex@denx.de> <1346453055-30888-4-git-send-email-marex@denx.de> Message-ID: <201209012214.45559.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.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 > Cc: Wolfgang Denk [...] > @@ -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,