Skip to content
Snippets Groups Projects
Commit 47c9c76b authored by Marek Vasut's avatar Marek Vasut Committed by Minkyu Kang
Browse files

arm: exynos: Squash bogus warnings in pinmux


Squash these warnings in pinmux.c found with GCC 4.8:

/arch/arm/cpu/armv7/exynos/pinmux.c: In function 'exynos_pinmux_config':
/arch/arm/cpu/armv7/exynos/pinmux.c:687:28: warning: 'count' may be used uninitialized in this function [-Wmaybe-uninitialized]
  for (i = start; i < start + count; i++) {
                            ^
/arch/arm/cpu/armv7/exynos/pinmux.c:663:16: note: 'count' was declared here
  int i, start, count;
                ^
/arch/arm/cpu/armv7/exynos/pinmux.c:687:28: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized]
  for (i = start; i < start + count; i++) {
                            ^
/arch/arm/cpu/armv7/exynos/pinmux.c:663:9: note: 'start' was declared here
  int i, start, count;
         ^
/arch/arm/cpu/armv7/exynos/pinmux.c:689:19: warning: 'bank' may be used uninitialized in this function [-Wmaybe-uninitialized]
   s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
                   ^
/arch/arm/cpu/armv7/exynos/pinmux.c:662:24: note: 'bank' was declared here
  struct s5p_gpio_bank *bank;
                        ^
/arch/arm/cpu/armv7/exynos/pinmux.c: In function 'exynos_pinmux_config':
/arch/arm/cpu/armv7/exynos/pinmux.c:687:28: warning: 'count' may be used uninitialized in this function [-Wmaybe-uninitialized]
  for (i = start; i < start + count; i++) {
                            ^
/arch/arm/cpu/armv7/exynos/pinmux.c:663:16: note: 'count' was declared here
  int i, start, count;
                ^
/arch/arm/cpu/armv7/exynos/pinmux.c:687:28: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized]
  for (i = start; i < start + count; i++) {
                            ^
/arch/arm/cpu/armv7/exynos/pinmux.c:663:9: note: 'start' was declared here
  int i, start, count;
         ^
/arch/arm/cpu/armv7/exynos/pinmux.c:689:19: warning: 'bank' may be used uninitialized in this function [-Wmaybe-uninitialized]
   s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
                   ^
/arch/arm/cpu/armv7/exynos/pinmux.c:662:24: note: 'bank' was declared here
  struct s5p_gpio_bank *bank;
                        ^

Note that the warning is bogus, the function can never be called with invalid
'peripheral' argument. GCC just cannot analyze this.

Signed-off-by: default avatarMarek Vasut <marex@denx.de>
Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Cc: Akshay Saraswat <akshay.s@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@ti.com>
Acked-by: default avatarSimon Glass <sjg@chromium.org>
Acked-by: default avatarRajeshwari S Shinde <rajeshwari.s@samsung.com>
Signed-off-by: default avatarLukasz Majewski <l.majewski@samsung.com>
Signed-off-by: default avatarMinkyu Kang <mk7.kang@samsung.com>
parent 1ecab0f3
No related branches found
No related tags found
No related merge requests found
...@@ -39,6 +39,9 @@ static void exynos5_uart_config(int peripheral) ...@@ -39,6 +39,9 @@ static void exynos5_uart_config(int peripheral)
start = 4; start = 4;
count = 2; count = 2;
break; break;
default:
debug("%s: invalid peripheral %d", __func__, peripheral);
return;
} }
for (i = start; i < start + count; i++) { for (i = start; i < start + count; i++) {
s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE); s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
...@@ -74,6 +77,9 @@ static void exynos5420_uart_config(int peripheral) ...@@ -74,6 +77,9 @@ static void exynos5420_uart_config(int peripheral)
start = 4; start = 4;
count = 2; count = 2;
break; break;
default:
debug("%s: invalid peripheral %d", __func__, peripheral);
return;
} }
for (i = start; i < start + count; i++) { for (i = start; i < start + count; i++) {
...@@ -110,6 +116,9 @@ static int exynos5_mmc_config(int peripheral, int flags) ...@@ -110,6 +116,9 @@ static int exynos5_mmc_config(int peripheral, int flags)
bank = &gpio1->c4; bank = &gpio1->c4;
bank_ext = NULL; bank_ext = NULL;
break; break;
default:
debug("%s: invalid peripheral %d", __func__, peripheral);
return -1;
} }
if ((flags & PINMUX_FLAG_8BIT_MODE) && !bank_ext) { if ((flags & PINMUX_FLAG_8BIT_MODE) && !bank_ext) {
debug("SDMMC device %d does not support 8bit mode", debug("SDMMC device %d does not support 8bit mode",
...@@ -683,6 +692,9 @@ static void exynos4_uart_config(int peripheral) ...@@ -683,6 +692,9 @@ static void exynos4_uart_config(int peripheral)
start = 4; start = 4;
count = 2; count = 2;
break; break;
default:
debug("%s: invalid peripheral %d", __func__, peripheral);
return;
} }
for (i = start; i < start + count; i++) { for (i = start; i < start + count; i++) {
s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE); s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment