summaryrefslogtreecommitdiff
path: root/arch/arm/mm/pmsa-v7.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2017-11-02 15:20:31 +0300
committerRussell King <rmk+kernel@armlinux.org.uk>2017-11-06 14:59:19 +0300
commitfe9c0589eeef4b3edbaad9f7500679a2eeafe951 (patch)
treed2315231c3ee527497cb8c6d18d45a35c878e983 /arch/arm/mm/pmsa-v7.c
parent216218308cfb0939aeecb246b34faf6e179c8d57 (diff)
downloadlinux-fe9c0589eeef4b3edbaad9f7500679a2eeafe951.tar.xz
ARM: 8719/1: NOMMU: work around maybe-uninitialized warning
The reworked MPU code produces a new warning in some configurations, presumably starting with the code move after the compiler now makes different inlining decisions: arch/arm/mm/pmsa-v7.c: In function 'adjust_lowmem_bounds_mpu': arch/arm/mm/pmsa-v7.c:310:5: error: 'specified_mem_size' may be used uninitialized in this function [-Werror=maybe-uninitialized] This appears to be harmless, as we know that there is always at least one memblock, and the only way this could get triggered is if the for_each_memblock() loop was never entered. I could not come up with a better workaround than initializing the specified_mem_size to zero, but at least that is the value that the variable would have in the hypothetical case of no memblocks. Fixes: 877ec119dbbf ("ARM: 8706/1: NOMMU: Move out MPU setup in separate module") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'arch/arm/mm/pmsa-v7.c')
-rw-r--r--arch/arm/mm/pmsa-v7.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mm/pmsa-v7.c b/arch/arm/mm/pmsa-v7.c
index 106ae1c435a3..976df60ac426 100644
--- a/arch/arm/mm/pmsa-v7.c
+++ b/arch/arm/mm/pmsa-v7.c
@@ -234,7 +234,7 @@ static int __init allocate_region(phys_addr_t base, phys_addr_t size,
/* MPU initialisation functions */
void __init adjust_lowmem_bounds_mpu(void)
{
- phys_addr_t specified_mem_size, total_mem_size = 0;
+ phys_addr_t specified_mem_size = 0, total_mem_size = 0;
struct memblock_region *reg;
bool first = true;
phys_addr_t mem_start;