aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/renesas/rcar
diff options
context:
space:
mode:
authorJustin Chadwell <justin.chadwell@arm.com>2019-09-17 15:21:50 +0100
committerMadhukar Pappireddy <madhukar.pappireddy@arm.com>2019-11-19 08:53:16 -0600
commitb7f6525db642d533327403ff8130eb91190f2e98 (patch)
treefcca63549f0f8c7ab15e706c6995de38aa2290d0 /drivers/staging/renesas/rcar
parentb8baa9346aaad24f8da48e408e0dbd5e65619905 (diff)
downloadtrusted-firmware-a-b7f6525db642d533327403ff8130eb91190f2e98.tar.gz
Enable -Wshadow always
Variable shadowing is, according to the C standard, permitted and valid behaviour. However, allowing a local variable to take the same name as a global one can cause confusion and can make refactoring and bug hunting more difficult. This patch moves -Wshadow from WARNING2 into the general warning group so it is always used. It also fixes all warnings that this introduces by simply renaming the local variable to a new name Change-Id: I6b71bdce6580c6e58b5e0b41e4704ab0aa38576e Signed-off-by: Justin Chadwell <justin.chadwell@arm.com>
Diffstat (limited to 'drivers/staging/renesas/rcar')
-rw-r--r--drivers/staging/renesas/rcar/ddr/ddr_b/boot_init_dram.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/staging/renesas/rcar/ddr/ddr_b/boot_init_dram.c b/drivers/staging/renesas/rcar/ddr/ddr_b/boot_init_dram.c
index 9f7c954900..1d6e83a2c7 100644
--- a/drivers/staging/renesas/rcar/ddr/ddr_b/boot_init_dram.c
+++ b/drivers/staging/renesas/rcar/ddr/ddr_b/boot_init_dram.c
@@ -254,10 +254,10 @@ static void ddrtbl_setval(uint32_t *tbl, uint32_t _regdef, uint32_t val);
static uint32_t ddrtbl_getval(uint32_t *tbl, uint32_t _regdef);
static uint32_t ddrphy_regif_chk(void);
static inline void ddrphy_regif_idle(void);
-static uint16_t _f_scale(uint32_t ddr_mbps, uint32_t ddr_mbpsdiv, uint32_t ps,
+static uint16_t _f_scale(uint32_t _ddr_mbps, uint32_t _ddr_mbpsdiv, uint32_t ps,
uint16_t cyc);
-static void _f_scale_js2(uint32_t ddr_mbps, uint32_t ddr_mbpsdiv,
- uint16_t *js2);
+static void _f_scale_js2(uint32_t _ddr_mbps, uint32_t _ddr_mbpsdiv,
+ uint16_t *_js2);
static int16_t _f_scale_adj(int16_t ps);
static void ddrtbl_load(void);
static void ddr_config_sub(void);
@@ -991,15 +991,15 @@ static uint16_t js2[JS2_CNT];
static uint8_t RL;
static uint8_t WL;
-static uint16_t _f_scale(uint32_t ddr_mbps, uint32_t ddr_mbpsdiv, uint32_t ps,
+static uint16_t _f_scale(uint32_t _ddr_mbps, uint32_t _ddr_mbpsdiv, uint32_t ps,
uint16_t cyc)
{
uint32_t tmp;
uint32_t div;
- tmp = (((uint32_t)(ps) + 9) / 10) * ddr_mbps;
- div = tmp / (200000 * ddr_mbpsdiv);
- if (tmp != (div * 200000 * ddr_mbpsdiv))
+ tmp = (((uint32_t)(ps) + 9) / 10) * _ddr_mbps;
+ div = tmp / (200000 * _ddr_mbpsdiv);
+ if (tmp != (div * 200000 * _ddr_mbpsdiv))
div = div + 1;
if (div > cyc)
@@ -1007,19 +1007,19 @@ static uint16_t _f_scale(uint32_t ddr_mbps, uint32_t ddr_mbpsdiv, uint32_t ps,
return cyc;
}
-static void _f_scale_js2(uint32_t ddr_mbps, uint32_t ddr_mbpsdiv,
- uint16_t *js2)
+static void _f_scale_js2(uint32_t _ddr_mbps, uint32_t _ddr_mbpsdiv,
+ uint16_t *_js2)
{
int i;
for (i = 0; i < JS2_TBLCNT; i++) {
- js2[i] = _f_scale(ddr_mbps, ddr_mbpsdiv,
+ _js2[i] = _f_scale(_ddr_mbps, _ddr_mbpsdiv,
1UL * jedec_spec2[JS2_DERATE][i].ps,
jedec_spec2[JS2_DERATE][i].cyc);
}
- js2[js2_trcpb] = js2[js2_tras] + js2[js2_trppb];
- js2[js2_trcab] = js2[js2_tras] + js2[js2_trpab];
+ _js2[js2_trcpb] = _js2[js2_tras] + _js2[js2_trppb];
+ _js2[js2_trcab] = _js2[js2_tras] + _js2[js2_trpab];
}
/* scaler for DELAY value */