Skip to contentSkip to conversation

libsas: fix endianness bug in sas_ata

SCSI Jeff Garzik 1 participant 1 message Apr 18, 2008 1 message not in the archive SCSI

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

drivers/scsi/libsas/sas_ata.c static int sas_discover_sata_dev(struct domain_device *dev) · line 704

Quoted 11 lines · Linux Kernel Mailing List
drivers/scsi/libsas/sas_ata.c +1 -1
@@ -698,7 +698,7 @@ static int sas_discover_sata_dev(struct domain_device *dev)
 		/* incomplete response */
 		SAS_DPRINTK("sending SET FEATURE/PUP_STBY_SPIN_UP to "
 			    "dev %llx\n", SAS_ADDR(dev->sas_addr));
-		if (!le16_to_cpu(identify_x[83] & (1<<6)))
+		if (!(identify_x[83] & cpu_to_le16(1<<6)))
 			goto cont1;
 		res = sas_issue_ata_cmd(dev, ATA_SET_FEATURES,
 					ATA_FEATURE_PUP_STBY_SPIN_UP,

Note that this code (not the patch, the code itself) duplicates libata code performing the same task...

We really need to get libsas going on the new EH. We don't need this sort of needless code duplication.

Jeff