From: Andy Shevchenko Date: Mon, 21 Dec 2020 12:30:06 +0000 (+0200) Subject: IOMUX: Refactor iomux_doenv() in order to increase readability X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=c939e1ca5d952cad05f4aa14135cba2b1b1947e0;p=u-boot.git 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 Reviewed-by: Simon Glass --- diff --git a/common/iomux.c b/common/iomux.c index 7b7b063cfc..7991235d11 100644 --- a/common/iomux.c +++ b/common/iomux.c @@ -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) {