diff options
author | Ye Li <ye.li@nxp.com> | 2018-11-12 03:05:32 -0800 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2018-11-12 20:09:51 -0800 |
commit | 876f435b632fd6ef1f7cfd1f7752861f1da90118 (patch) | |
tree | 45a21398fb93b543437b6b73da0cdc0443d64845 /drivers | |
parent | 8f52ef83dbfc9f1c812b2166a7322a16efcbf939 (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>
Diffstat (limited to 'drivers')
-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 4e35e0a2ec..b381d23877 100644 --- a/drivers/ata/dwc_ahsata.c +++ b/drivers/ata/dwc_ahsata.c @@ -222,7 +222,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) { |