From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Date: Mon, 21 Dec 2020 14:30:06 +0200 Subject: [PATCH v3 7/9] IOMUX: Refactor iomux_doenv() in order to increase readability In-Reply-To: <20201221123008.9930-1-andriy.shevchenko@linux.intel.com> References: <20201221123008.9930-1-andriy.shevchenko@linux.intel.com> Message-ID: <20201221123008.9930-7-andriy.shevchenko@linux.intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- v3: added tag common/iomux.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/common/iomux.c b/common/iomux.c index 7b7b063cfc6b..7991235d1197 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) { -- 2.29.2