[PATCH v3 8/9] IOMUX: Drop indentation level by removing redundant 'else'

Andy Shevchenko andriy.shevchenko at linux.intel.com
Mon Dec 21 13:30:07 CET 2020


Obviously the following has unnecessary indentation level in 'else' branch.

	if (foo) {
		...
		return;
	} else {
		...
	}

Drop indentation level by removing redundant 'else'.

Signed-off-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
Reviewed-by: Simon Glass <sjg at chromium.org>
---
v3: added tag
 common/iomux.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/common/iomux.c b/common/iomux.c
index 7991235d1197..126d92ce850f 100644
--- a/common/iomux.c
+++ b/common/iomux.c
@@ -126,12 +126,12 @@ int iomux_doenv(const int console, const char *arg)
 	if (cs_idx == 0) {
 		free(cons_set);
 		return 1;
-	} else {
-		/* Works even if console_devices[console] is NULL. */
-		free(console_devices[console]);
-		console_devices[console] = cons_set;
-		cd_count[console] = cs_idx;
 	}
+
+	/* Works even if console_devices[console] is NULL. */
+	free(console_devices[console]);
+	console_devices[console] = cons_set;
+	cd_count[console] = cs_idx;
 	return 0;
 }
 #endif /* CONSOLE_MUX */
-- 
2.29.2



More information about the U-Boot mailing list