diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-12-21 14:30:06 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-01-15 14:38:00 -0500 |
commit | c939e1ca5d952cad05f4aa14135cba2b1b1947e0 (patch) | |
tree | 91d7d53c395a946655a614959eb5fa21666198c8 /common | |
parent | 1f8e6985db8e1eb25a8644102216c9cd5174b7a3 (diff) | |
download | u-boot-c939e1ca5d952cad05f4aa14135cba2b1b1947e0.tar.gz u-boot-c939e1ca5d952cad05f4aa14135cba2b1b1947e0.tar.bz2 u-boot-c939e1ca5d952cad05f4aa14135cba2b1b1947e0.zip |
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>
Diffstat (limited to 'common')
-rw-r--r-- | common/iomux.c | 13 |
1 files changed, 6 insertions, 7 deletions
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) { |