From 22db0167670f4f3d6858656ccd47fd5c8320f9a8 Mon Sep 17 00:00:00 2001 From: Haojian Zhuang Date: Wed, 31 May 2017 12:42:10 +0800 Subject: [PATCH] hikey: fix uninitialized variable in ddr code Fix uninitliazed variable in ddr driver code. Signed-off-by: Haojian Zhuang --- plat/hisilicon/hikey/hikey_ddr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plat/hisilicon/hikey/hikey_ddr.c b/plat/hisilicon/hikey/hikey_ddr.c index 6328eb69..ab572eb1 100644 --- a/plat/hisilicon/hikey/hikey_ddr.c +++ b/plat/hisilicon/hikey/hikey_ddr.c @@ -385,7 +385,7 @@ static void ddrx_rdet(void) static void ddrx_wdet(void) { - unsigned int data, wdet, zero_bdl, dq[4]; + unsigned int data, wdet, zero_bdl = 0, dq[4]; int i; data = mmio_read_32((0xf712c000 + 0x0d0)); @@ -454,11 +454,11 @@ static void ddrx_wdet(void) for (i = 0; i < 4; i++) { data = mmio_read_32((0xf712c000 + 0x210 + i * 0x80)); if ((!(data & 0x1f)) || (!(data & 0x1f00)) || - (!(data & 0x1f0000)) || (!(data & 0x1f000000))) + (!(data & 0x1f0000)) || (!(data & 0x1f000000))) zero_bdl = 1; data = mmio_read_32((0xf712c000 + 0x214 + i * 0x80)); if ((!(data & 0x1f)) || (!(data & 0x1f00)) || - (!(data & 0x1f0000)) || (!(data & 0x1f000000))) + (!(data & 0x1f0000)) || (!(data & 0x1f000000))) zero_bdl = 1; data = mmio_read_32((0xf712c000 + 0x218 + i * 0x80)); if (!(data & 0x1f)) -- 2.30.2