summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2018-11-12 03:05:32 -0800
committerYe Li <ye.li@nxp.com>2020-04-26 23:26:36 -0700
commit53d6ac19ebc27828beeff92e7dbe7317e0026919 (patch)
treeb33ff6a1ed24ec141c4c168b3660af12fe1626e8
parent3dcb2034e9bc2cbf2d3deb30e3dfd37f7b6da435 (diff)
MLK-20240-2 sata: ahsata: Fix wrong operand for checking SERR DIAG_X
Fix coverity issue CID 3261683: Wrong operator used (CONSTANT_EXPRESSION_RESULT) operator_confusion: ({...; __v;}) | 67108864 is always 1/true regardless of the values of its operand. This occurs as the logical operand of ! When DIAG_X is set, the PHY COMINIT signal is detected, so should use '&' to check whether it is set. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 876f435b632fd6ef1f7cfd1f7752861f1da90118) (cherry picked from commit e1076ddb3ecc76105c15a3c95861167a23a8ee37)
-rw-r--r--drivers/ata/dwc_ahsata.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/dwc_ahsata.c b/drivers/ata/dwc_ahsata.c
index c821b248169..77369f9c72a 100644
--- a/drivers/ata/dwc_ahsata.c
+++ b/drivers/ata/dwc_ahsata.c
@@ -223,7 +223,7 @@ static int ahci_host_init(struct ahci_uc_priv *uc_priv)
/* Wait for COMINIT bit 26 (DIAG_X) in SERR */
timeout = 1000;
- while (!(readl(&port_mmio->serr) | SATA_PORT_SERR_DIAG_X)
+ while (!(readl(&port_mmio->serr) & SATA_PORT_SERR_DIAG_X)
&& --timeout)
;
if (timeout <= 0) {