aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mvsas
diff options
context:
space:
mode:
authorAndy Yan <ayan@marvell.com>2009-05-14 20:41:21 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-05-23 16:44:13 -0400
commitf9da3be5afc08c40e7f7a395c8935d500a6898b1 (patch)
treef6ea4ed4d198e8cea1a19c9d3b233f2a242ddfd1 /drivers/scsi/mvsas
parent4421c9ebeeacf3d9c4e6aa558e1a777178e71add (diff)
[SCSI] mvsas: remove all the casts from void * or to void *
Signed-off-by: Ying Chu <jasonchu@marvell.com> Signed-off-by: Andy Yan <ayan@marvell.com> Signed-off-by: Ke Wei <kewei@marvell.com Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/mvsas')
-rw-r--r--drivers/scsi/mvsas/mv_sas.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c
index c05e4c05a414..0d2138641214 100644
--- a/drivers/scsi/mvsas/mv_sas.c
+++ b/drivers/scsi/mvsas/mv_sas.c
@@ -28,7 +28,7 @@ static int mvs_find_tag(struct mvs_info *mvi, struct sas_task *task, u32 *tag)
28{ 28{
29 if (task->lldd_task) { 29 if (task->lldd_task) {
30 struct mvs_slot_info *slot; 30 struct mvs_slot_info *slot;
31 slot = (struct mvs_slot_info *) task->lldd_task; 31 slot = task->lldd_task;
32 *tag = slot->slot_tag; 32 *tag = slot->slot_tag;
33 return 1; 33 return 1;
34 } 34 }
@@ -37,7 +37,7 @@ static int mvs_find_tag(struct mvs_info *mvi, struct sas_task *task, u32 *tag)
37 37
38void mvs_tag_clear(struct mvs_info *mvi, u32 tag) 38void mvs_tag_clear(struct mvs_info *mvi, u32 tag)
39{ 39{
40 void *bitmap = (void *) &mvi->tags; 40 void *bitmap = &mvi->tags;
41 clear_bit(tag, bitmap); 41 clear_bit(tag, bitmap);
42} 42}
43 43
@@ -48,14 +48,14 @@ void mvs_tag_free(struct mvs_info *mvi, u32 tag)
48 48
49void mvs_tag_set(struct mvs_info *mvi, unsigned int tag) 49void mvs_tag_set(struct mvs_info *mvi, unsigned int tag)
50{ 50{
51 void *bitmap = (void *) &mvi->tags; 51 void *bitmap = &mvi->tags;
52 set_bit(tag, bitmap); 52 set_bit(tag, bitmap);
53} 53}
54 54
55inline int mvs_tag_alloc(struct mvs_info *mvi, u32 *tag_out) 55inline int mvs_tag_alloc(struct mvs_info *mvi, u32 *tag_out)
56{ 56{
57 unsigned int index, tag; 57 unsigned int index, tag;
58 void *bitmap = (void *) &mvi->tags; 58 void *bitmap = &mvi->tags;
59 59
60 index = find_first_zero_bit(bitmap, mvi->tags_num); 60 index = find_first_zero_bit(bitmap, mvi->tags_num);
61 tag = index; 61 tag = index;
@@ -591,8 +591,7 @@ static int mvs_task_prep_ata(struct mvs_info *mvi,
591{ 591{
592 struct sas_task *task = tei->task; 592 struct sas_task *task = tei->task;
593 struct domain_device *dev = task->dev; 593 struct domain_device *dev = task->dev;
594 struct mvs_device *mvi_dev = 594 struct mvs_device *mvi_dev = dev->lldd_dev;
595 (struct mvs_device *)dev->lldd_dev;
596 struct mvs_cmd_hdr *hdr = tei->hdr; 595 struct mvs_cmd_hdr *hdr = tei->hdr;
597 struct asd_sas_port *sas_port = dev->port; 596 struct asd_sas_port *sas_port = dev->port;
598 struct mvs_slot_info *slot; 597 struct mvs_slot_info *slot;
@@ -733,8 +732,7 @@ static int mvs_task_prep_ssp(struct mvs_info *mvi,
733 struct mvs_cmd_hdr *hdr = tei->hdr; 732 struct mvs_cmd_hdr *hdr = tei->hdr;
734 struct mvs_port *port = tei->port; 733 struct mvs_port *port = tei->port;
735 struct domain_device *dev = task->dev; 734 struct domain_device *dev = task->dev;
736 struct mvs_device *mvi_dev = 735 struct mvs_device *mvi_dev = dev->lldd_dev;
737 (struct mvs_device *)dev->lldd_dev;
738 struct asd_sas_port *sas_port = dev->port; 736 struct asd_sas_port *sas_port = dev->port;
739 struct mvs_slot_info *slot; 737 struct mvs_slot_info *slot;
740 void *buf_prd; 738 void *buf_prd;
@@ -894,7 +892,7 @@ static int mvs_task_exec(struct sas_task *task, const int num, gfp_t gfp_flags,
894 spin_lock_irqsave(&mvi->lock, flags); 892 spin_lock_irqsave(&mvi->lock, flags);
895 do { 893 do {
896 dev = t->dev; 894 dev = t->dev;
897 mvi_dev = (struct mvs_device *)dev->lldd_dev; 895 mvi_dev = dev->lldd_dev;
898 if (DEV_IS_GONE(mvi_dev)) { 896 if (DEV_IS_GONE(mvi_dev)) {
899 if (mvi_dev) 897 if (mvi_dev)
900 mv_dprintk("device %d not ready.\n", 898 mv_dprintk("device %d not ready.\n",
@@ -987,7 +985,7 @@ static int mvs_task_exec(struct sas_task *task, const int num, gfp_t gfp_flags,
987 } 985 }
988 slot->task = t; 986 slot->task = t;
989 slot->port = tei.port; 987 slot->port = tei.port;
990 t->lldd_task = (void *) slot; 988 t->lldd_task = slot;
991 list_add_tail(&slot->entry, &tei.port->list); 989 list_add_tail(&slot->entry, &tei.port->list);
992 /* TODO: select normal or high priority */ 990 /* TODO: select normal or high priority */
993 spin_lock(&t->task_state_lock); 991 spin_lock(&t->task_state_lock);
@@ -1139,7 +1137,7 @@ static void *mvs_get_d2h_reg(struct mvs_info *mvi, int i, void *buf)
1139 if (((s[1] & 0x00FFFFFF) == 0x00EB1401) && (*(u8 *)&s[3] == 0x01)) 1137 if (((s[1] & 0x00FFFFFF) == 0x00EB1401) && (*(u8 *)&s[3] == 0x01))
1140 s[1] = 0x00EB1401 | (*((u8 *)&s[1] + 3) & 0x10); 1138 s[1] = 0x00EB1401 | (*((u8 *)&s[1] + 3) & 0x10);
1141 1139
1142 return (void *)s; 1140 return s;
1143} 1141}
1144 1142
1145static u32 mvs_is_sig_fis_received(u32 irq_status) 1143static u32 mvs_is_sig_fis_received(u32 irq_status)
@@ -1176,7 +1174,7 @@ void mvs_update_phyinfo(struct mvs_info *mvi, int i, int get_st)
1176 sas_phy->oob_mode = SATA_OOB_MODE; 1174 sas_phy->oob_mode = SATA_OOB_MODE;
1177 phy->frame_rcvd_size = 1175 phy->frame_rcvd_size =
1178 sizeof(struct dev_to_host_fis); 1176 sizeof(struct dev_to_host_fis);
1179 mvs_get_d2h_reg(mvi, i, (void *)id); 1177 mvs_get_d2h_reg(mvi, i, id);
1180 } else { 1178 } else {
1181 u32 tmp; 1179 u32 tmp;
1182 dev_printk(KERN_DEBUG, mvi->dev, 1180 dev_printk(KERN_DEBUG, mvi->dev,
@@ -1317,7 +1315,7 @@ int mvs_dev_found_notify(struct domain_device *dev, int lock)
1317 res = -1; 1315 res = -1;
1318 goto found_out; 1316 goto found_out;
1319 } 1317 }
1320 dev->lldd_dev = (void *)mvi_device; 1318 dev->lldd_dev = mvi_device;
1321 mvi_device->dev_type = dev->dev_type; 1319 mvi_device->dev_type = dev->dev_type;
1322 mvi_device->mvi_info = mvi; 1320 mvi_device->mvi_info = mvi;
1323 if (parent_dev && DEV_IS_EXPANDER(parent_dev->dev_type)) { 1321 if (parent_dev && DEV_IS_EXPANDER(parent_dev->dev_type)) {
@@ -1356,7 +1354,7 @@ int mvs_dev_found(struct domain_device *dev)
1356void mvs_dev_gone_notify(struct domain_device *dev, int lock) 1354void mvs_dev_gone_notify(struct domain_device *dev, int lock)
1357{ 1355{
1358 unsigned long flags = 0; 1356 unsigned long flags = 0;
1359 struct mvs_device *mvi_dev = (struct mvs_device *)dev->lldd_dev; 1357 struct mvs_device *mvi_dev = dev->lldd_dev;
1360 struct mvs_info *mvi = mvi_dev->mvi_info; 1358 struct mvs_info *mvi = mvi_dev->mvi_info;
1361 1359
1362 if (lock) 1360 if (lock)
@@ -1532,7 +1530,7 @@ int mvs_lu_reset(struct domain_device *dev, u8 *lun)
1532 unsigned long flags; 1530 unsigned long flags;
1533 int i, phyno[WIDE_PORT_MAX_PHY], num , rc = TMF_RESP_FUNC_FAILED; 1531 int i, phyno[WIDE_PORT_MAX_PHY], num , rc = TMF_RESP_FUNC_FAILED;
1534 struct mvs_tmf_task tmf_task; 1532 struct mvs_tmf_task tmf_task;
1535 struct mvs_device * mvi_dev = (struct mvs_device *)dev->lldd_dev; 1533 struct mvs_device * mvi_dev = dev->lldd_dev;
1536 struct mvs_info *mvi = mvi_dev->mvi_info; 1534 struct mvs_info *mvi = mvi_dev->mvi_info;
1537 1535
1538 tmf_task.tmf = TMF_LU_RESET; 1536 tmf_task.tmf = TMF_LU_RESET;
@@ -1654,7 +1652,7 @@ int mvs_abort_task(struct sas_task *task)
1654 struct mvs_slot_info *slot; 1652 struct mvs_slot_info *slot;
1655 1653
1656 if (task->lldd_task) { 1654 if (task->lldd_task) {
1657 slot = (struct mvs_slot_info *)task->lldd_task; 1655 slot = task->lldd_task;
1658 slot_no = (u32) (slot - mvi->slot_info); 1656 slot_no = (u32) (slot - mvi->slot_info);
1659 mvs_slot_complete(mvi, slot_no, 1); 1657 mvs_slot_complete(mvi, slot_no, 1);
1660 } 1658 }
@@ -1708,7 +1706,7 @@ int mvs_clear_task_set(struct domain_device *dev, u8 *lun)
1708static int mvs_sata_done(struct mvs_info *mvi, struct sas_task *task, 1706static int mvs_sata_done(struct mvs_info *mvi, struct sas_task *task,
1709 u32 slot_idx, int err) 1707 u32 slot_idx, int err)
1710{ 1708{
1711 struct mvs_device *mvi_dev = (struct mvs_device *)task->dev->lldd_dev; 1709 struct mvs_device *mvi_dev = task->dev->lldd_dev;
1712 struct task_status_struct *tstat = &task->task_status; 1710 struct task_status_struct *tstat = &task->task_status;
1713 struct ata_task_resp *resp = (struct ata_task_resp *)tstat->buf; 1711 struct ata_task_resp *resp = (struct ata_task_resp *)tstat->buf;
1714 int stat = SAM_GOOD; 1712 int stat = SAM_GOOD;
@@ -1785,7 +1783,7 @@ int mvs_slot_complete(struct mvs_info *mvi, u32 rx_desc, u32 flags)
1785 return -1; 1783 return -1;
1786 1784
1787 tstat = &task->task_status; 1785 tstat = &task->task_status;
1788 mvi_dev = (struct mvs_device *)task->dev->lldd_dev; 1786 mvi_dev = task->dev->lldd_dev;
1789 1787
1790 mvs_hba_cq_dump(mvi); 1788 mvs_hba_cq_dump(mvi);
1791 1789