drivers/ddr: Fix possible out of bounds error
authorYork Sun <yorksun@freescale.com>
Tue, 1 Apr 2014 21:20:49 +0000 (14:20 -0700)
committerYork Sun <yorksun@freescale.com>
Wed, 23 Apr 2014 00:58:49 +0000 (17:58 -0700)
commit349689b8021f0a7d7923099bd8bbe5eab117d4fa
treeeafb5be0e0ad33d739baa1ed885a7cdc9f412561
parent2ee6c52e229e1d0d1e78c3efbc67bc8bb868fb25
drivers/ddr: Fix possible out of bounds error

This is a theoretical possible out of bounds error in DDR driver. Adding
check before using array index. Also change some runtime conditions to
pre-compiling conditions.

Signed-off-by: York Sun <yorksun@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
drivers/ddr/fsl/ctrl_regs.c
drivers/ddr/fsl/main.c
drivers/ddr/fsl/options.c