Skip to contentSkip to conversation

memory: of_memory: Silence uninitialized variable warning

PATCH New Dan Carpenter 1 participant 1 message Apr 15, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memory: of_memory: Silence uninitialized variable warning

Presumably we never use the default: case statement which prints a warning message. But my static checker complains that if we do, we will hit an uninitialized variable warning.

drivers/memory/of_memory.c +1 -1
index 6007435..9daf94b 100644
@@ -109,7 +109,7 @@ const struct lpddr2_timings *of_get_ddr_timings(struct device_node *np_ddr,
 	struct lpddr2_timings	*timings = NULL;
 	u32			arr_sz = 0, i = 0;
 	struct device_node	*np_tim;
-	char			*tim_compat;
+	char			*tim_compat = NULL;
 
 	switch (device_type) {
 	case DDR_TYPE_LPDDR2_S2: