]> git.baikalelectronics.ru Git - kernel.git/commit
vexpress/spc: fix a build warning on array bounds
authorAlex Shi <alex.shi@linaro.org>
Wed, 16 Jul 2014 11:21:56 +0000 (19:21 +0800)
committerOlof Johansson <olof@lixom.net>
Sun, 31 Aug 2014 17:22:10 +0000 (10:22 -0700)
commitbb9fe865a2ebbb135d5e61a510bc73ebd2bb92c6
treee56d73d325a766d69f433460a34157116e58491e
parent149fe77dbaacb046328c4c13c408d60a9ad3320f
vexpress/spc: fix a build warning on array bounds

With ARCH_VEXPRESS_SPC option, kernel build has the following
warning:

arch/arm/mach-vexpress/spc.c: In function ‘ve_spc_clk_init’:
arch/arm/mach-vexpress/spc.c:431:38: warning: array subscript is below array bounds [-Warray-bounds]
  struct ve_spc_opp *opps = info->opps[cluster];
                                      ^
since 'cluster' maybe '-1' in UP system. This patch does a active
checking to fix this issue.

Signed-off-by: Alex Shi <alex.shi@linaro.org>
Acked-by: Pawel Moll <pawel.moll@arm.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
arch/arm/mach-vexpress/spc.c