public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] dwc_ahsata: use bitwise operator in sata_port_status
@ 2014-10-28 12:59 Nikita Kiryanov
  2014-10-28 18:20 ` Jeroen Hofstee
  2014-10-28 22:54 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Nikita Kiryanov @ 2014-10-28 12:59 UTC (permalink / raw)
  To: u-boot

The logic of the return statement in sata_port_status() calls for a
bitwise 'AND' operator, not logical 'AND'. Fix the typo.

Reported-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Cc: Jeroen Hofstee <jeroen@myspectrum.nl>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
---
 drivers/block/dwc_ahsata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/dwc_ahsata.c b/drivers/block/dwc_ahsata.c
index 29f478b..c68fd2f 100644
--- a/drivers/block/dwc_ahsata.c
+++ b/drivers/block/dwc_ahsata.c
@@ -878,7 +878,7 @@ int sata_port_status(int dev, int port)
 	probe_ent = (struct ahci_probe_ent *)sata_dev_desc[dev].priv;
 	port_mmio = (struct sata_port_regs *)probe_ent->port[port].port_mmio;
 
-	return readl(&(port_mmio->ssts)) && SATA_PORT_SSTS_DET_MASK;
+	return readl(&(port_mmio->ssts)) & SATA_PORT_SSTS_DET_MASK;
 }
 
 /*
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-28 22:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-28 12:59 [U-Boot] [PATCH] dwc_ahsata: use bitwise operator in sata_port_status Nikita Kiryanov
2014-10-28 18:20 ` Jeroen Hofstee
2014-10-28 22:54 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox