Skip to contentSkip to conversation

Please fix warning of Exynos

U-Boot Masahiro Yamada 2 participants 2 messages Jul 30, 2014

lore
Share & tools
lore
#0 lore raw

Hi, Samsung developers,

I notice the following warning when building Exynos family:

arch/arm/cpu/armv7/exynos/clock.c: In function 'clock_get_periph_rate':
arch/arm/cpu/armv7/exynos/clock.c:263:47: warning: array subscript is above array bounds [-Warray-bounds]

  struct clk_bit_info *bit_info = &clk_bit_info[peripheral];
                                               ^
arch/arm/cpu/armv7/exynos/clock.c:263:47: warning: array subscript is above array bounds [-Warray-bounds]
arch/arm/cpu/armv7/exynos/clock.c: In function 'clock_get_periph_rate':
arch/arm/cpu/armv7/exynos/clock.c:263:47: warning: array subscript is above array bounds [-Warray-bounds]
  struct clk_bit_info *bit_info = &clk_bit_info[peripheral];
                                               ^

arch/arm/cpu/armv7/exynos/clock.c:263:47: warning: array subscript is above array bounds [-Warray-bounds]

I think the cause is that
PERIPH_ID_PWM0 is defined as 132, but clk_bit_info has much smaller array size.

You can repeat this with this toolchain:
https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/x86_64-gcc-4.9.0-nolibc_arm-unknown-linux-gnueabi.tar.xz

Best Regards
Masahiro Yamada

#1 lore raw

Hi, Masahiro.

Thanks for pointing out.
I will check it.

Best Regards,
Jaehoon Chung

Quoted 42 lines · Masahiro Yamada

Hi, Samsung developers,

I notice the following warning when building Exynos family:

arch/arm/cpu/armv7/exynos/clock.c: In function 'clock_get_periph_rate':
arch/arm/cpu/armv7/exynos/clock.c:263:47: warning: array subscript is above array bounds [-Warray-bounds]

  struct clk_bit_info *bit_info = &clk_bit_info[peripheral];
                                               ^
arch/arm/cpu/armv7/exynos/clock.c:263:47: warning: array subscript is above array bounds [-Warray-bounds]
arch/arm/cpu/armv7/exynos/clock.c: In function 'clock_get_periph_rate':
arch/arm/cpu/armv7/exynos/clock.c:263:47: warning: array subscript is above array bounds [-Warray-bounds]
  struct clk_bit_info *bit_info = &clk_bit_info[peripheral];
                                               ^

arch/arm/cpu/armv7/exynos/clock.c:263:47: warning: array subscript is above array bounds [-Warray-bounds]

I think the cause is that
PERIPH_ID_PWM0 is defined as 132, but clk_bit_info has much smaller array size.

You can repeat this with this toolchain:
https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/x86_64-gcc-4.9.0-nolibc_arm-unknown-linux-gnueabi.tar.xz

Best Regards
Masahiro Yamada

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot