mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
IOMUX: Refactor iomux_doenv() in order to increase readability
Refactor iomux_doenv() a bit in order to increase readability. There is no change in code generation on x86. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
1f8e6985db
commit
c939e1ca5d
1 changed files with 6 additions and 7 deletions
|
@ -45,15 +45,14 @@ int iomux_doenv(const int console, const char *arg)
|
|||
i = 0;
|
||||
temp = console_args;
|
||||
for (;;) {
|
||||
temp = strchr(temp, ',');
|
||||
if (temp != NULL) {
|
||||
i++;
|
||||
temp++;
|
||||
continue;
|
||||
}
|
||||
/* There's always one entry more than the number of commas. */
|
||||
i++;
|
||||
break;
|
||||
|
||||
temp = strchr(temp, ',');
|
||||
if (temp == NULL)
|
||||
break;
|
||||
|
||||
temp++;
|
||||
}
|
||||
start = (char **)malloc(i * sizeof(char *));
|
||||
if (start == NULL) {
|
||||
|
|
Loading…
Reference in a new issue