Skip to content
Snippets Groups Projects
Commit 3a8653b3 authored by Doug Anderson's avatar Doug Anderson Committed by Wolfgang Denk
Browse files

cosmetic: Fixup fixup_silent_linux() for checkpatch

parent eaeecde7
No related branches found
No related tags found
No related merge requests found
...@@ -1200,34 +1200,35 @@ U_BOOT_CMD( ...@@ -1200,34 +1200,35 @@ U_BOOT_CMD(
/* helper routines */ /* helper routines */
/*******************************************************************/ /*******************************************************************/
#ifdef CONFIG_SILENT_CONSOLE #ifdef CONFIG_SILENT_CONSOLE
static void fixup_silent_linux () static void fixup_silent_linux(void)
{ {
char buf[256], *start, *end; char buf[256], *start, *end;
char *cmdline = getenv ("bootargs"); char *cmdline = getenv("bootargs");
/* Only fix cmdline when requested */ /* Only fix cmdline when requested */
if (!(gd->flags & GD_FLG_SILENT)) if (!(gd->flags & GD_FLG_SILENT))
return; return;
debug ("before silent fix-up: %s\n", cmdline); debug("before silent fix-up: %s\n", cmdline);
if (cmdline) { if (cmdline) {
if ((start = strstr (cmdline, "console=")) != NULL) { start = strstr(cmdline, "console=");
end = strchr (start, ' '); if (start) {
strncpy (buf, cmdline, (start - cmdline + 8)); end = strchr(start, ' ');
strncpy(buf, cmdline, (start - cmdline + 8));
if (end) if (end)
strcpy (buf + (start - cmdline + 8), end); strcpy(buf + (start - cmdline + 8), end);
else else
buf[start - cmdline + 8] = '\0'; buf[start - cmdline + 8] = '\0';
} else { } else {
strcpy (buf, cmdline); strcpy(buf, cmdline);
strcat (buf, " console="); strcat(buf, " console=");
} }
} else { } else {
strcpy (buf, "console="); strcpy(buf, "console=");
} }
setenv ("bootargs", buf); setenv("bootargs", buf);
debug ("after silent fix-up: %s\n", buf); debug("after silent fix-up: %s\n", buf);
} }
#endif /* CONFIG_SILENT_CONSOLE */ #endif /* CONFIG_SILENT_CONSOLE */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment