drm/nouveau/bios/ramcfg: fix missing parentheses when calculating RON
authorColin Ian King <colin.king@canonical.com>
Sun, 25 Nov 2018 17:09:18 +0000 (17:09 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jan 2020 09:24:17 +0000 (10:24 +0100)
commit3e5c8e8a2debb8cdb152bf526a181f66f085ae92
treef0c37d021d1b37c4e1f61f7c9329a33d468ae4b1
parent51ed708bee63a2726593d715697b0d644c9b994e
drm/nouveau/bios/ramcfg: fix missing parentheses when calculating RON

[ Upstream commit 13649101a25c53c87f4ab98a076dfe61f3636ab1 ]

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: c25bf7b6155c ("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>
drivers/gpu/drm/nouveau/nvkm/subdev/fb/gddr3.c