[U-Boot] [PATCH] pinmux:exynos:uart:fix: Add default statement to remove warnings (gcc-4.8.2)

Lukasz Majewski l.majewski at samsung.com
Wed Mar 5 17:04:17 CET 2014


For Exynos' pinmux UART implementation there was a possibility to run
for() statement with uninitialized bank, start and count values.

Those warnings appear when following toolchain is used (gcc-4.8.2-glibc-2.18-binutils-2.24):

warning: 'count' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Lukasz Majewski <l.majewski at samsung.com>
Cc: Minkyu Kang <mk7.kang at samsung.com>
---
 arch/arm/cpu/armv7/exynos/pinmux.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c b/arch/arm/cpu/armv7/exynos/pinmux.c
index 645c497..494f608 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -39,6 +39,9 @@ static void exynos5_uart_config(int peripheral)
 		start = 4;
 		count = 2;
 		break;
+	default:
+		error("UART device %d not implemented\n", peripheral);
+		return;
 	}
 	for (i = start; i < start + count; i++) {
 		s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
@@ -74,6 +77,9 @@ static void exynos5420_uart_config(int peripheral)
 		start = 4;
 		count = 2;
 		break;
+	default:
+		error("UART device %d not implemented\n", peripheral);
+		return;
 	}
 
 	for (i = start; i < start + count; i++) {
@@ -683,6 +689,9 @@ static void exynos4_uart_config(int peripheral)
 		start = 4;
 		count = 2;
 		break;
+	default:
+		error("UART device %d not implemented\n", peripheral);
+		return;
 	}
 	for (i = start; i < start + count; i++) {
 		s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
-- 
1.7.10.4



More information about the U-Boot mailing list