soc/nvidia/tegra124: Correct bitwise operators

We are treating reg_val like a bit mask, so use bitwise or instead of
boolean or, and use |= to enable certain bits instead of overwriting the
whole variable.

Change-Id: Ia8c0ea5a58e25b3b58ed82caba20f8e49a30fb68
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Found-by: Coverity CID 1287070
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34560
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
This commit is contained in:
Jacob Garber 2019-07-24 15:15:20 -06:00 committed by Patrick Georgi
parent 532f205a05
commit 83369fa6f4
1 changed files with 2 additions and 2 deletions

View File

@ -348,10 +348,10 @@ static void tegra_dc_sor_io_set_dpd(struct tegra_dc_sor_data *sor, int up)
} }
reg_val = READL(pmc_base + APBDEV_PMC_IO_DPD2_REQ); reg_val = READL(pmc_base + APBDEV_PMC_IO_DPD2_REQ);
reg_val &= ~(APBDEV_PMC_IO_DPD2_REQ_LVDS_ON || reg_val &= ~(APBDEV_PMC_IO_DPD2_REQ_LVDS_ON |
APBDEV_PMC_IO_DPD2_REQ_CODE_DEFAULT_MASK); APBDEV_PMC_IO_DPD2_REQ_CODE_DEFAULT_MASK);
reg_val = up ? APBDEV_PMC_IO_DPD2_REQ_LVDS_ON | reg_val |= up ? APBDEV_PMC_IO_DPD2_REQ_LVDS_ON |
APBDEV_PMC_IO_DPD2_REQ_CODE_DPD_OFF : APBDEV_PMC_IO_DPD2_REQ_CODE_DPD_OFF :
APBDEV_PMC_IO_DPD2_REQ_LVDS_OFF | APBDEV_PMC_IO_DPD2_REQ_LVDS_OFF |
APBDEV_PMC_IO_DPD2_REQ_CODE_DPD_ON; APBDEV_PMC_IO_DPD2_REQ_CODE_DPD_ON;