提交 c939e1ca 编写于 作者: A Andy Shevchenko 提交者: Tom Rini

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: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: NSimon Glass <sjg@chromium.org>
上级 1f8e6985
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册