mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
drm/nouveau/bios/ramcfg: fix missing parentheses when calculating RON
[ Upstream commit13649101a2] Currently, the expression for calculating RON is always going to result in zero no matter the value of ram->mr[1] because the ! operator has higher precedence than the shift >> operator. I believe the missing parentheses around the expression before appying the ! operator will result in the desired result. [ Note, not tested ] Detected by CoveritScan, CID#1324005 ("Operands don't affect result") Fixes:c25bf7b615("drm/nouveau/bios/ramcfg: Separate out RON pull value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
@@ -87,7 +87,7 @@ nvkm_gddr3_calc(struct nvkm_ram *ram)
|
||||
WR = (ram->next->bios.timing[2] & 0x007f0000) >> 16;
|
||||
/* XXX: Get these values from the VBIOS instead */
|
||||
DLL = !(ram->mr[1] & 0x1);
|
||||
RON = !(ram->mr[1] & 0x300) >> 8;
|
||||
RON = !((ram->mr[1] & 0x300) >> 8);
|
||||
break;
|
||||
default:
|
||||
return -ENOSYS;
|
||||
|
||||
Reference in New Issue
Block a user