summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Russ <[email protected]>2009-08-23 12:59:51 +1000
committerTom Rix <[email protected]>2009-10-03 09:04:10 -0500
commit70d841f55d8d4cb6c1ace40148c4e8f5f0777995 (patch)
tree664cef78e1221e923e53eece28f0050a2d564bbb
parented3afafd487d1557e175d53270aa3f44427e5632 (diff)
Misc SATA fixups
Cast first parameter to sata_cpy() In /drivers/block/ata_piix.h, ata_id_has_lba48(), ata_id_has_lba(), ata_id_has_dma(), ata_id_u32(), ata_id_u64() are all defined in include/libata.h which is included in ata.h which is included by all files which include ata_piix.h (only ata_piix.c) so these definitions are supurflous to (and conlict with) this in libata.h. Interestingly, my compiler complains about ata_id_u64 already being defined, but not ata_id_u32 ata_dump_id() is defined in include/libata.h and should not be static (maybe should even use ata_dump_id() in libata.c Signed-off-by: Graeme Russ <[email protected]>
-rw-r--r--drivers/block/ata_piix.c10
-rw-r--r--drivers/block/ata_piix.h15
2 files changed, 6 insertions, 19 deletions
diff --git a/drivers/block/ata_piix.c b/drivers/block/ata_piix.c
index 549de31235b..c81d11a6ce3 100644
--- a/drivers/block/ata_piix.c
+++ b/drivers/block/ata_piix.c
@@ -310,7 +310,7 @@ sata_bus_softreset (int num)
}
if (status & ATA_BUSY)
- printf ("ata%u is slow to respond,plz be patient\n", port);
+ printf ("ata%u is slow to respond,plz be patient\n", num);
while ((status & ATA_BUSY)) {
msleep (100);
@@ -318,7 +318,7 @@ sata_bus_softreset (int num)
}
if (status & ATA_BUSY) {
- printf ("ata%u failed to respond : ", port);
+ printf ("ata%u failed to respond : ", num);
printf ("bus reset failed\n");
return 1;
}
@@ -389,11 +389,11 @@ sata_identify (int num, int dev)
return;
}
- sata_cpy (sata_dev_desc[devno].revision, iop->fw_rev,
+ sata_cpy ((unsigned char *)sata_dev_desc[devno].revision, iop->fw_rev,
sizeof (sata_dev_desc[devno].revision));
- sata_cpy (sata_dev_desc[devno].vendor, iop->model,
+ sata_cpy ((unsigned char *)sata_dev_desc[devno].vendor, iop->model,
sizeof (sata_dev_desc[devno].vendor));
- sata_cpy (sata_dev_desc[devno].product, iop->serial_no,
+ sata_cpy ((unsigned char *)sata_dev_desc[devno].product, iop->serial_no,
sizeof (sata_dev_desc[devno].product));
strswab (sata_dev_desc[devno].revision);
strswab (sata_dev_desc[devno].vendor);
diff --git a/drivers/block/ata_piix.h b/drivers/block/ata_piix.h
index 11885af20e9..9157cf82c0b 100644
--- a/drivers/block/ata_piix.h
+++ b/drivers/block/ata_piix.h
@@ -37,20 +37,7 @@ struct sata_port {
/***********SATA LIBRARY SPECIFIC DEFINITIONS AND DECLARATIONS**************/
#ifdef SATA_DECL /*SATA library specific declarations */
-#define ata_id_has_lba48(id) ((id)[83] & (1 << 10))
-#define ata_id_has_lba(id) ((id)[49] & (1 << 9))
-#define ata_id_has_dma(id) ((id)[49] & (1 << 8))
-#define ata_id_u32(id,n) \
- (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)]))
-#define ata_id_u64(id,n) \
- (((u64) (id)[(n) + 3] << 48) | \
- ((u64) (id)[(n) + 2] << 32) | \
- ((u64) (id)[(n) + 1] << 16) | \
- ((u64) (id)[(n) + 0]) )
-#endif
-
-#ifdef SATA_DECL /*SATA library specific declarations */
-static inline void
+inline void
ata_dump_id (u16 * id)
{
PRINTF ("49 = 0x%04x "