Skip to contentSkip to conversation

memory: tegra: fix fdc test bug

PATCH In review Ben Dooks 2 participants 3 messages Apr 7, 2017

Subsystems (2)
lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/1 memory: tegra: fix fdc test bug

The fdc variable is a bool, taking the address of this will generally produce true, thus skewing any users of the tegra_mc_set_latency_allowance code.

Note, this does not seem to be producing a compiler warning. This was only spotted as it meant a caller was seeing 3 times higher than expected register results.

---
 drivers/memory/tegra/mc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memory/tegra/mc.c +1 -1
index fb44d1741862..e20470736319 100644
@@ -121,7 +121,7 @@ int tegra_mc_set_latency_allowance(int client_id, unsigned int bandwidth)
 
 	WARN_ON(client->id != client_id);
 
-	if (&client->fdc)
+	if (client->fdc)
 		atom_bytes = plat_mc->soc->atom_size_fdc;
 	else
 		atom_bytes = plat_mc->soc->atom_size;
Signature · 1 line
2.11.0
#1 lore raw
Quoted 4 lines · Ben Dooks

The fdc variable is a bool, taking the address of this will generally produce true, thus skewing any users of the tegra_mc_set_latency_allowance code.

Quoted 8 lines

Note, this does not seem to be producing a compiler warning. This was only spotted as it meant a caller was seeing 3 times higher than expected register results.

---
 drivers/memory/tegra/mc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

What tree is this based on? I don't see this code anywhere in mainline.

Thierry

author
#2 lore raw
Quoted 9 lines · Thierry Reding
Quoted 8 lines · Ben Dooks

The fdc variable is a bool, taking the address of this will generally produce true, thus skewing any users of the tegra_mc_set_latency_allowance code.

Note, this does not seem to be producing a compiler warning. This was only spotted as it meant a caller was seeing 3 times higher than expected register results.

Quoted 6 lines
Quoted 4 lines
---
 drivers/memory/tegra/mc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

What tree is this based on? I don't see this code anywhere in mainline.

Apologies, turns out this a vendor added function.

Signature · 1 line
Ben