Skip to contentSkip to conversation

arm: removed compiler warning

PATCH In review John de la Garza 2 participants 2 messages Feb 17, 2014 – Feb 21, 2014 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: removed compiler warning

Removed this compiler warning for arch/arm/boot/compressed/atags_to_fdt.c. The warning was: 'memsize' may be used uninitialized in this function.

---
 arch/arm/boot/compressed/atags_to_fdt.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/boot/compressed/atags_to_fdt.c +2 -1
index d1153c8..75b64da 100644
@@ -110,7 +110,8 @@ int atags_to_fdt(void *atag_list, void *fdt, int total_space)
 	 * address and size for each bank */
 	uint32_t mem_reg_property[2 * 2 * NR_BANKS];
 	int memcount = 0;
-	int ret, memsize;
+	int memsize = 0;
+	int ret;
 
 	/* make sure we've got an aligned pointer */
 	if ((u32)atag_list & 0x3)
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · John de la Garza

Removed this compiler warning for arch/arm/boot/compressed/atags_to_fdt.c. The warning was: 'memsize' may be used uninitialized in this function.

Indeed it was an error, thanks to have fixed it.

Quoted 1 line
Quoted 19 lines
---
 arch/arm/boot/compressed/atags_to_fdt.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/boot/compressed/atags_to_fdt.c +2 -1
index d1153c8..75b64da 100644
@@ -110,7 +110,8 @@ int atags_to_fdt(void *atag_list, void *fdt, int total_space)
 	 * address and size for each bank */
 	uint32_t mem_reg_property[2 * 2 * NR_BANKS];
 	int memcount = 0;
-	int ret, memsize;
+	int memsize = 0;
+	int ret;
 
 	/* make sure we've got an aligned pointer */
 	if ((u32)atag_list & 0x3)
Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com