Skip to contentSkip to conversation

dwc_ahsata: use bitwise operator in sata_port_status

PATCH New Nikita Kiryanov 3 participants 3 messages Oct 28, 2014 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dwc_ahsata: use bitwise operator in sata_port_status

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

---
 drivers/block/dwc_ahsata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/dwc_ahsata.c +1 -1
index 29f478b..c68fd2f 100644
@@ -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;
 }
 
 /*
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 dwc_ahsata: use bitwise operator in sata_port_status

Hello Nikita,

Quoted 16 lines · Nikita Kiryanov

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

---
  drivers/block/dwc_ahsata.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/dwc_ahsata.c +0 -0
index 29f478b..c68fd2f 100644

drivers/block/dwc_ahsata.c int sata_port_status(int dev, int port) · line 884

Quoted 8 lines
drivers/block/dwc_ahsata.c +1 -1
@@ -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;
  }
 
  /*

And squashes a warning ;)

Regards,
Jeroen

#2 lore raw

PATCH 1/1 dwc_ahsata: use bitwise operator in sata_port_status

In reply to Nikita Kiryanov
Quoted 7 lines · Nikita Kiryanov

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

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141028/b3d1cb42/attachment.pgp>