arm: exynos: pinmux: avoid the using uninitialized variable 38/155538/2
authorJaehoon Chung <jh80.chung@samsung.com>
Fri, 13 Oct 2017 02:52:40 +0000 (11:52 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 13 Oct 2017 11:38:13 +0000 (11:38 +0000)
If there is no hit in statement, some variables are used as
uninitialized status.
This patch is for avoiding this cases.

Change-Id: I41c2b25c24f2ca12a54eb700ba1f7daf2afeaccd
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
arch/arm/cpu/armv7/exynos/pinmux.c

index 6693675f41f2f4cd2089fb9e6578a348a4d8a312..8d586ee141ff37d93df187cfa4f7502626bbe390 100644 (file)
@@ -127,8 +127,11 @@ static void exynos5_uart_config(int peripheral)
                        bank = &gpio4->a1;
                        start = 4;
                        count = 2;
-               }
+               } else
+                       return;
                break;
+       default:
+               return;
        }
        for (i = start; i < start + count; i++) {
                s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
@@ -160,6 +163,8 @@ static void exynos5430_uart_config(int peripheral)
                start = 4;
                count = 2;
                break;
+       default:
+               return;
        }
        for (i = start; i < start + count; i++) {
                s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
@@ -554,6 +559,8 @@ static void exynos5_input_config(int peripheral)
                start = 0;
                count = 1;
                break;
+       default:
+               return;
        }
        for (i = start; i < start + count; i++) {
                s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
@@ -585,6 +592,8 @@ static void exynos5430_input_config(int peripheral)
                start = 1;
                count = 1;
                break;
+       default:
+               return;
        }
        for (i = start; i < start + count; i++) {
                s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);