From: Haojian Zhuang Date: Wed, 31 May 2017 04:42:10 +0000 (+0800) Subject: hikey: fix uninitialized variable in ddr code X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=22db0167670f4f3d6858656ccd47fd5c8320f9a8;p=project%2Fbcm63xx%2Fatf.git hikey: fix uninitialized variable in ddr code Fix uninitliazed variable in ddr driver code. Signed-off-by: Haojian Zhuang --- 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))