diff options
author | Ye Li | 2020-05-03 22:27:01 +0800 |
---|---|---|
committer | Tom Rini | 2020-05-08 18:29:03 -0400 |
commit | 87e2cb530fc147676319b7c639e7ce138ddf385e (patch) | |
tree | 1ba18b7de8ffb92a89e0dc8dcc58eaa8b35f795b /drivers/ata | |
parent | bf38cbf9a289c41a0db6697c280ede73340191e7 (diff) |
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>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/dwc_ahsata.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/dwc_ahsata.c b/drivers/ata/dwc_ahsata.c index a7752147928..4b37a023380 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) { |