File mv-ddr.diff of Package arm-trusted-firmware

From 05b227877ee70bb9ca6824ef36df66b2de1c396a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
Date: Sun, 10 Jun 2018 13:46:49 +0200
Subject: [PATCH] mv_ddr4_training_leveling: Fix GCC 8 build error
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Building with openSUSE Tumbleweed's GCC 8.1.1 results in the following
build error:

  mv_ddr4_training_leveling.c: In function 'mv_ddr4_dynamic_pb_wl_supp':
  mv_ddr4_training_leveling.c:454:8: error: 'wr_data' may be used uninitialized in this function [-Werror=maybe-uninitialized]
          ddr3_tip_bus_write(dev_num, ACCESS_TYPE_UNICAST, if_id,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
               ACCESS_TYPE_UNICAST, subphy_num,
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
               DDR_PHY_DATA,
               ~~~~~~~~~~~~~
               WL_PHY_REG(effective_cs), wr_data);
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is due to the case of orig_phase == 0 resulting in an uninitialized
wr_data variable being passed to the above function.

Fix this error by zero-initializing the variable.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 mv_ddr4_training_leveling.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mv_ddr4_training_leveling.c b/mv_ddr4_training_leveling.c
index e44f987..cb61e9a 100644
--- a/mv_ddr4_training_leveling.c
+++ b/mv_ddr4_training_leveling.c
@@ -368,7 +368,7 @@ static int mv_ddr4_dynamic_pb_wl_supp(u32 dev_num, enum mv_wl_supp_mode ecc_mode
 	u32 subphy_num = ddr3_tip_dev_attr_get(dev_num, MV_ATTR_OCTET_PER_INTERFACE);
 	u8 compare_result = 0;
 	u32 orig_phase;
-	u32 rd_data, wr_data;
+	u32 rd_data, wr_data = 0;
 	u32 flag, step;
 	struct mv_ddr_topology_map *tm = mv_ddr_topology_map_get();
 	u32 ecc_phy_access_id;
-- 
2.16.4