aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic94xx
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2008-03-28 17:48:34 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-04-07 13:19:08 -0400
commit81e56ded878aeb8730f18c1d0a70d5face788be3 (patch)
tree18485d237927fb1d95179bc1e03d4ebe6ef7d389 /drivers/scsi/aic94xx
parentd70d4667e9eead06aa38be947274fda22dcf923b (diff)
[SCSI] aic94xx: cleanups
- static functions in .c files shouldn't be marked inline - make needlessly global code static - remove the unused aic94xx_seq.c:asd_unpause_lseq() - #if 0 other unused code [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/aic94xx')
-rw-r--r--drivers/scsi/aic94xx/aic94xx_dev.c8
-rw-r--r--drivers/scsi/aic94xx/aic94xx_dump.c10
-rw-r--r--drivers/scsi/aic94xx/aic94xx_dump.h9
-rw-r--r--drivers/scsi/aic94xx/aic94xx_hwi.c24
-rw-r--r--drivers/scsi/aic94xx/aic94xx_hwi.h2
-rw-r--r--drivers/scsi/aic94xx/aic94xx_init.c8
-rw-r--r--drivers/scsi/aic94xx/aic94xx_reg.c53
-rw-r--r--drivers/scsi/aic94xx/aic94xx_scb.c33
-rw-r--r--drivers/scsi/aic94xx/aic94xx_sds.c4
-rw-r--r--drivers/scsi/aic94xx/aic94xx_seq.c31
-rw-r--r--drivers/scsi/aic94xx/aic94xx_seq.h4
-rw-r--r--drivers/scsi/aic94xx/aic94xx_task.c12
-rw-r--r--drivers/scsi/aic94xx/aic94xx_tmf.c2
13 files changed, 87 insertions, 113 deletions
diff --git a/drivers/scsi/aic94xx/aic94xx_dev.c b/drivers/scsi/aic94xx/aic94xx_dev.c
index 72042cae7768..2e2ddec9c0b6 100644
--- a/drivers/scsi/aic94xx/aic94xx_dev.c
+++ b/drivers/scsi/aic94xx/aic94xx_dev.c
@@ -35,7 +35,7 @@
35#define SET_DDB(_ddb, _ha) set_bit(_ddb, (_ha)->hw_prof.ddb_bitmap) 35#define SET_DDB(_ddb, _ha) set_bit(_ddb, (_ha)->hw_prof.ddb_bitmap)
36#define CLEAR_DDB(_ddb, _ha) clear_bit(_ddb, (_ha)->hw_prof.ddb_bitmap) 36#define CLEAR_DDB(_ddb, _ha) clear_bit(_ddb, (_ha)->hw_prof.ddb_bitmap)
37 37
38static inline int asd_get_ddb(struct asd_ha_struct *asd_ha) 38static int asd_get_ddb(struct asd_ha_struct *asd_ha)
39{ 39{
40 int ddb, i; 40 int ddb, i;
41 41
@@ -71,7 +71,7 @@ out:
71#define NCQ_DATA_SCB_PTR offsetof(struct asd_ddb_stp_sata_target_port, ncq_data_scb_ptr) 71#define NCQ_DATA_SCB_PTR offsetof(struct asd_ddb_stp_sata_target_port, ncq_data_scb_ptr)
72#define ITNL_TIMEOUT offsetof(struct asd_ddb_ssp_smp_target_port, itnl_timeout) 72#define ITNL_TIMEOUT offsetof(struct asd_ddb_ssp_smp_target_port, itnl_timeout)
73 73
74static inline void asd_free_ddb(struct asd_ha_struct *asd_ha, int ddb) 74static void asd_free_ddb(struct asd_ha_struct *asd_ha, int ddb)
75{ 75{
76 if (!ddb || ddb >= 0xFFFF) 76 if (!ddb || ddb >= 0xFFFF)
77 return; 77 return;
@@ -79,7 +79,7 @@ static inline void asd_free_ddb(struct asd_ha_struct *asd_ha, int ddb)
79 CLEAR_DDB(ddb, asd_ha); 79 CLEAR_DDB(ddb, asd_ha);
80} 80}
81 81
82static inline void asd_set_ddb_type(struct domain_device *dev) 82static void asd_set_ddb_type(struct domain_device *dev)
83{ 83{
84 struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha; 84 struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha;
85 int ddb = (int) (unsigned long) dev->lldd_dev; 85 int ddb = (int) (unsigned long) dev->lldd_dev;
@@ -109,7 +109,7 @@ static int asd_init_sata_tag_ddb(struct domain_device *dev)
109 return 0; 109 return 0;
110} 110}
111 111
112static inline int asd_init_sata(struct domain_device *dev) 112static int asd_init_sata(struct domain_device *dev)
113{ 113{
114 struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha; 114 struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha;
115 int ddb = (int) (unsigned long) dev->lldd_dev; 115 int ddb = (int) (unsigned long) dev->lldd_dev;
diff --git a/drivers/scsi/aic94xx/aic94xx_dump.c b/drivers/scsi/aic94xx/aic94xx_dump.c
index 3d8c4ff1f2ef..67eeba3bdb06 100644
--- a/drivers/scsi/aic94xx/aic94xx_dump.c
+++ b/drivers/scsi/aic94xx/aic94xx_dump.c
@@ -738,6 +738,8 @@ static void asd_dump_lseq_state(struct asd_ha_struct *asd_ha, int lseq)
738 PRINT_LMIP_dword(asd_ha, lseq, DEV_PRES_TIMER_TERM_TS); 738 PRINT_LMIP_dword(asd_ha, lseq, DEV_PRES_TIMER_TERM_TS);
739} 739}
740 740
741#if 0
742
741/** 743/**
742 * asd_dump_ddb_site -- dump a CSEQ DDB site 744 * asd_dump_ddb_site -- dump a CSEQ DDB site
743 * @asd_ha: pointer to host adapter structure 745 * @asd_ha: pointer to host adapter structure
@@ -880,6 +882,8 @@ void asd_dump_scb_sites(struct asd_ha_struct *asd_ha)
880 } 882 }
881} 883}
882 884
885#endif /* 0 */
886
883/** 887/**
884 * ads_dump_seq_state -- dump CSEQ and LSEQ states 888 * ads_dump_seq_state -- dump CSEQ and LSEQ states
885 * @asd_ha: pointer to host adapter structure 889 * @asd_ha: pointer to host adapter structure
@@ -922,7 +926,9 @@ void asd_dump_frame_rcvd(struct asd_phy *phy,
922 spin_unlock_irqrestore(&phy->sas_phy.frame_rcvd_lock, flags); 926 spin_unlock_irqrestore(&phy->sas_phy.frame_rcvd_lock, flags);
923} 927}
924 928
925static inline void asd_dump_scb(struct asd_ascb *ascb, int ind) 929#if 0
930
931static void asd_dump_scb(struct asd_ascb *ascb, int ind)
926{ 932{
927 asd_printk("scb%d: vaddr: 0x%p, dma_handle: 0x%llx, next: 0x%llx, " 933 asd_printk("scb%d: vaddr: 0x%p, dma_handle: 0x%llx, next: 0x%llx, "
928 "index:%d, opcode:0x%02x\n", 934 "index:%d, opcode:0x%02x\n",
@@ -956,4 +962,6 @@ void asd_dump_scb_list(struct asd_ascb *ascb, int num)
956 } 962 }
957} 963}
958 964
965#endif /* 0 */
966
959#endif /* ASD_DEBUG */ 967#endif /* ASD_DEBUG */
diff --git a/drivers/scsi/aic94xx/aic94xx_dump.h b/drivers/scsi/aic94xx/aic94xx_dump.h
index 0c388e7da6bb..191a753d42a7 100644
--- a/drivers/scsi/aic94xx/aic94xx_dump.h
+++ b/drivers/scsi/aic94xx/aic94xx_dump.h
@@ -29,24 +29,15 @@
29 29
30#ifdef ASD_DEBUG 30#ifdef ASD_DEBUG
31 31
32void asd_dump_ddb_0(struct asd_ha_struct *asd_ha);
33void asd_dump_target_ddb(struct asd_ha_struct *asd_ha, u16 site_no);
34void asd_dump_scb_sites(struct asd_ha_struct *asd_ha);
35void asd_dump_seq_state(struct asd_ha_struct *asd_ha, u8 lseq_mask); 32void asd_dump_seq_state(struct asd_ha_struct *asd_ha, u8 lseq_mask);
36void asd_dump_frame_rcvd(struct asd_phy *phy, 33void asd_dump_frame_rcvd(struct asd_phy *phy,
37 struct done_list_struct *dl); 34 struct done_list_struct *dl);
38void asd_dump_scb_list(struct asd_ascb *ascb, int num);
39#else /* ASD_DEBUG */ 35#else /* ASD_DEBUG */
40 36
41static inline void asd_dump_ddb_0(struct asd_ha_struct *asd_ha) { }
42static inline void asd_dump_target_ddb(struct asd_ha_struct *asd_ha,
43 u16 site_no) { }
44static inline void asd_dump_scb_sites(struct asd_ha_struct *asd_ha) { }
45static inline void asd_dump_seq_state(struct asd_ha_struct *asd_ha, 37static inline void asd_dump_seq_state(struct asd_ha_struct *asd_ha,
46 u8 lseq_mask) { } 38 u8 lseq_mask) { }
47static inline void asd_dump_frame_rcvd(struct asd_phy *phy, 39static inline void asd_dump_frame_rcvd(struct asd_phy *phy,
48 struct done_list_struct *dl) { } 40 struct done_list_struct *dl) { }
49static inline void asd_dump_scb_list(struct asd_ascb *ascb, int num) { }
50#endif /* ASD_DEBUG */ 41#endif /* ASD_DEBUG */
51 42
52#endif /* _AIC94XX_DUMP_H_ */ 43#endif /* _AIC94XX_DUMP_H_ */
diff --git a/drivers/scsi/aic94xx/aic94xx_hwi.c b/drivers/scsi/aic94xx/aic94xx_hwi.c
index 940a207a42fb..83a78222896d 100644
--- a/drivers/scsi/aic94xx/aic94xx_hwi.c
+++ b/drivers/scsi/aic94xx/aic94xx_hwi.c
@@ -250,7 +250,7 @@ static int asd_init_scbs(struct asd_ha_struct *asd_ha)
250 return 0; 250 return 0;
251} 251}
252 252
253static inline void asd_get_max_scb_ddb(struct asd_ha_struct *asd_ha) 253static void asd_get_max_scb_ddb(struct asd_ha_struct *asd_ha)
254{ 254{
255 asd_ha->hw_prof.max_scbs = asd_get_cmdctx_size(asd_ha)/ASD_SCB_SIZE; 255 asd_ha->hw_prof.max_scbs = asd_get_cmdctx_size(asd_ha)/ASD_SCB_SIZE;
256 asd_ha->hw_prof.max_ddbs = asd_get_devctx_size(asd_ha)/ASD_DDB_SIZE; 256 asd_ha->hw_prof.max_ddbs = asd_get_devctx_size(asd_ha)/ASD_DDB_SIZE;
@@ -771,7 +771,7 @@ static void asd_dl_tasklet_handler(unsigned long data)
771 * asd_process_donelist_isr -- schedule processing of done list entries 771 * asd_process_donelist_isr -- schedule processing of done list entries
772 * @asd_ha: pointer to host adapter structure 772 * @asd_ha: pointer to host adapter structure
773 */ 773 */
774static inline void asd_process_donelist_isr(struct asd_ha_struct *asd_ha) 774static void asd_process_donelist_isr(struct asd_ha_struct *asd_ha)
775{ 775{
776 tasklet_schedule(&asd_ha->seq.dl_tasklet); 776 tasklet_schedule(&asd_ha->seq.dl_tasklet);
777} 777}
@@ -780,7 +780,7 @@ static inline void asd_process_donelist_isr(struct asd_ha_struct *asd_ha)
780 * asd_com_sas_isr -- process device communication interrupt (COMINT) 780 * asd_com_sas_isr -- process device communication interrupt (COMINT)
781 * @asd_ha: pointer to host adapter structure 781 * @asd_ha: pointer to host adapter structure
782 */ 782 */
783static inline void asd_com_sas_isr(struct asd_ha_struct *asd_ha) 783static void asd_com_sas_isr(struct asd_ha_struct *asd_ha)
784{ 784{
785 u32 comstat = asd_read_reg_dword(asd_ha, COMSTAT); 785 u32 comstat = asd_read_reg_dword(asd_ha, COMSTAT);
786 786
@@ -819,7 +819,7 @@ static inline void asd_com_sas_isr(struct asd_ha_struct *asd_ha)
819 asd_chip_reset(asd_ha); 819 asd_chip_reset(asd_ha);
820} 820}
821 821
822static inline void asd_arp2_err(struct asd_ha_struct *asd_ha, u32 dchstatus) 822static void asd_arp2_err(struct asd_ha_struct *asd_ha, u32 dchstatus)
823{ 823{
824 static const char *halt_code[256] = { 824 static const char *halt_code[256] = {
825 "UNEXPECTED_INTERRUPT0", 825 "UNEXPECTED_INTERRUPT0",
@@ -906,7 +906,7 @@ static inline void asd_arp2_err(struct asd_ha_struct *asd_ha, u32 dchstatus)
906 * asd_dch_sas_isr -- process device channel interrupt (DEVINT) 906 * asd_dch_sas_isr -- process device channel interrupt (DEVINT)
907 * @asd_ha: pointer to host adapter structure 907 * @asd_ha: pointer to host adapter structure
908 */ 908 */
909static inline void asd_dch_sas_isr(struct asd_ha_struct *asd_ha) 909static void asd_dch_sas_isr(struct asd_ha_struct *asd_ha)
910{ 910{
911 u32 dchstatus = asd_read_reg_dword(asd_ha, DCHSTATUS); 911 u32 dchstatus = asd_read_reg_dword(asd_ha, DCHSTATUS);
912 912
@@ -921,7 +921,7 @@ static inline void asd_dch_sas_isr(struct asd_ha_struct *asd_ha)
921 * ads_rbi_exsi_isr -- process external system interface interrupt (INITERR) 921 * ads_rbi_exsi_isr -- process external system interface interrupt (INITERR)
922 * @asd_ha: pointer to host adapter structure 922 * @asd_ha: pointer to host adapter structure
923 */ 923 */
924static inline void asd_rbi_exsi_isr(struct asd_ha_struct *asd_ha) 924static void asd_rbi_exsi_isr(struct asd_ha_struct *asd_ha)
925{ 925{
926 u32 stat0r = asd_read_reg_dword(asd_ha, ASISTAT0R); 926 u32 stat0r = asd_read_reg_dword(asd_ha, ASISTAT0R);
927 927
@@ -969,7 +969,7 @@ static inline void asd_rbi_exsi_isr(struct asd_ha_struct *asd_ha)
969 * 969 *
970 * Asserted on PCIX errors: target abort, etc. 970 * Asserted on PCIX errors: target abort, etc.
971 */ 971 */
972static inline void asd_hst_pcix_isr(struct asd_ha_struct *asd_ha) 972static void asd_hst_pcix_isr(struct asd_ha_struct *asd_ha)
973{ 973{
974 u16 status; 974 u16 status;
975 u32 pcix_status; 975 u32 pcix_status;
@@ -1042,8 +1042,8 @@ irqreturn_t asd_hw_isr(int irq, void *dev_id)
1042 1042
1043/* ---------- SCB handling ---------- */ 1043/* ---------- SCB handling ---------- */
1044 1044
1045static inline struct asd_ascb *asd_ascb_alloc(struct asd_ha_struct *asd_ha, 1045static struct asd_ascb *asd_ascb_alloc(struct asd_ha_struct *asd_ha,
1046 gfp_t gfp_flags) 1046 gfp_t gfp_flags)
1047{ 1047{
1048 extern struct kmem_cache *asd_ascb_cache; 1048 extern struct kmem_cache *asd_ascb_cache;
1049 struct asd_seq_data *seq = &asd_ha->seq; 1049 struct asd_seq_data *seq = &asd_ha->seq;
@@ -1142,8 +1142,8 @@ struct asd_ascb *asd_ascb_alloc_list(struct asd_ha_struct
1142 * 1142 *
1143 * LOCKING: called with the pending list lock held. 1143 * LOCKING: called with the pending list lock held.
1144 */ 1144 */
1145static inline void asd_swap_head_scb(struct asd_ha_struct *asd_ha, 1145static void asd_swap_head_scb(struct asd_ha_struct *asd_ha,
1146 struct asd_ascb *ascb) 1146 struct asd_ascb *ascb)
1147{ 1147{
1148 struct asd_seq_data *seq = &asd_ha->seq; 1148 struct asd_seq_data *seq = &asd_ha->seq;
1149 struct asd_ascb *last = list_entry(ascb->list.prev, 1149 struct asd_ascb *last = list_entry(ascb->list.prev,
@@ -1169,7 +1169,7 @@ static inline void asd_swap_head_scb(struct asd_ha_struct *asd_ha,
1169 * intended to be called from asd_post_ascb_list(), just prior to 1169 * intended to be called from asd_post_ascb_list(), just prior to
1170 * posting the SCBs to the sequencer. 1170 * posting the SCBs to the sequencer.
1171 */ 1171 */
1172static inline void asd_start_scb_timers(struct list_head *list) 1172static void asd_start_scb_timers(struct list_head *list)
1173{ 1173{
1174 struct asd_ascb *ascb; 1174 struct asd_ascb *ascb;
1175 list_for_each_entry(ascb, list, list) { 1175 list_for_each_entry(ascb, list, list) {
diff --git a/drivers/scsi/aic94xx/aic94xx_hwi.h b/drivers/scsi/aic94xx/aic94xx_hwi.h
index abc757559c1a..8c1c28239e93 100644
--- a/drivers/scsi/aic94xx/aic94xx_hwi.h
+++ b/drivers/scsi/aic94xx/aic94xx_hwi.h
@@ -391,8 +391,6 @@ void asd_build_control_phy(struct asd_ascb *ascb, int phy_id, u8 subfunc);
391void asd_control_led(struct asd_ha_struct *asd_ha, int phy_id, int op); 391void asd_control_led(struct asd_ha_struct *asd_ha, int phy_id, int op);
392void asd_turn_led(struct asd_ha_struct *asd_ha, int phy_id, int op); 392void asd_turn_led(struct asd_ha_struct *asd_ha, int phy_id, int op);
393int asd_enable_phys(struct asd_ha_struct *asd_ha, const u8 phy_mask); 393int asd_enable_phys(struct asd_ha_struct *asd_ha, const u8 phy_mask);
394void asd_build_initiate_link_adm_task(struct asd_ascb *ascb, int phy_id,
395 u8 subfunc);
396 394
397void asd_ascb_timedout(unsigned long data); 395void asd_ascb_timedout(unsigned long data);
398int asd_chip_hardrst(struct asd_ha_struct *asd_ha); 396int asd_chip_hardrst(struct asd_ha_struct *asd_ha);
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index 806fa4d9a648..90f5e0a6f2e3 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -545,7 +545,7 @@ static struct asd_pcidev_struct {
545 }, 545 },
546}; 546};
547 547
548static inline int asd_create_ha_caches(struct asd_ha_struct *asd_ha) 548static int asd_create_ha_caches(struct asd_ha_struct *asd_ha)
549{ 549{
550 asd_ha->scb_pool = dma_pool_create(ASD_DRIVER_NAME "_scb_pool", 550 asd_ha->scb_pool = dma_pool_create(ASD_DRIVER_NAME "_scb_pool",
551 &asd_ha->pcidev->dev, 551 &asd_ha->pcidev->dev,
@@ -563,7 +563,7 @@ static inline int asd_create_ha_caches(struct asd_ha_struct *asd_ha)
563 * asd_free_edbs -- free empty data buffers 563 * asd_free_edbs -- free empty data buffers
564 * asd_ha: pointer to host adapter structure 564 * asd_ha: pointer to host adapter structure
565 */ 565 */
566static inline void asd_free_edbs(struct asd_ha_struct *asd_ha) 566static void asd_free_edbs(struct asd_ha_struct *asd_ha)
567{ 567{
568 struct asd_seq_data *seq = &asd_ha->seq; 568 struct asd_seq_data *seq = &asd_ha->seq;
569 int i; 569 int i;
@@ -574,7 +574,7 @@ static inline void asd_free_edbs(struct asd_ha_struct *asd_ha)
574 seq->edb_arr = NULL; 574 seq->edb_arr = NULL;
575} 575}
576 576
577static inline void asd_free_escbs(struct asd_ha_struct *asd_ha) 577static void asd_free_escbs(struct asd_ha_struct *asd_ha)
578{ 578{
579 struct asd_seq_data *seq = &asd_ha->seq; 579 struct asd_seq_data *seq = &asd_ha->seq;
580 int i; 580 int i;
@@ -589,7 +589,7 @@ static inline void asd_free_escbs(struct asd_ha_struct *asd_ha)
589 seq->escb_arr = NULL; 589 seq->escb_arr = NULL;
590} 590}
591 591
592static inline void asd_destroy_ha_caches(struct asd_ha_struct *asd_ha) 592static void asd_destroy_ha_caches(struct asd_ha_struct *asd_ha)
593{ 593{
594 int i; 594 int i;
595 595
diff --git a/drivers/scsi/aic94xx/aic94xx_reg.c b/drivers/scsi/aic94xx/aic94xx_reg.c
index f210dac3203d..56b17c22526e 100644
--- a/drivers/scsi/aic94xx/aic94xx_reg.c
+++ b/drivers/scsi/aic94xx/aic94xx_reg.c
@@ -32,8 +32,8 @@
32 * Offset comes before value to remind that the operation of 32 * Offset comes before value to remind that the operation of
33 * this function is *offs = val. 33 * this function is *offs = val.
34 */ 34 */
35static inline void asd_write_byte(struct asd_ha_struct *asd_ha, 35static void asd_write_byte(struct asd_ha_struct *asd_ha,
36 unsigned long offs, u8 val) 36 unsigned long offs, u8 val)
37{ 37{
38 if (unlikely(asd_ha->iospace)) 38 if (unlikely(asd_ha->iospace))
39 outb(val, 39 outb(val,
@@ -43,8 +43,8 @@ static inline void asd_write_byte(struct asd_ha_struct *asd_ha,
43 wmb(); 43 wmb();
44} 44}
45 45
46static inline void asd_write_word(struct asd_ha_struct *asd_ha, 46static void asd_write_word(struct asd_ha_struct *asd_ha,
47 unsigned long offs, u16 val) 47 unsigned long offs, u16 val)
48{ 48{
49 if (unlikely(asd_ha->iospace)) 49 if (unlikely(asd_ha->iospace))
50 outw(val, 50 outw(val,
@@ -54,8 +54,8 @@ static inline void asd_write_word(struct asd_ha_struct *asd_ha,
54 wmb(); 54 wmb();
55} 55}
56 56
57static inline void asd_write_dword(struct asd_ha_struct *asd_ha, 57static void asd_write_dword(struct asd_ha_struct *asd_ha,
58 unsigned long offs, u32 val) 58 unsigned long offs, u32 val)
59{ 59{
60 if (unlikely(asd_ha->iospace)) 60 if (unlikely(asd_ha->iospace))
61 outl(val, 61 outl(val,
@@ -67,8 +67,7 @@ static inline void asd_write_dword(struct asd_ha_struct *asd_ha,
67 67
68/* Reading from device address space. 68/* Reading from device address space.
69 */ 69 */
70static inline u8 asd_read_byte(struct asd_ha_struct *asd_ha, 70static u8 asd_read_byte(struct asd_ha_struct *asd_ha, unsigned long offs)
71 unsigned long offs)
72{ 71{
73 u8 val; 72 u8 val;
74 if (unlikely(asd_ha->iospace)) 73 if (unlikely(asd_ha->iospace))
@@ -80,8 +79,8 @@ static inline u8 asd_read_byte(struct asd_ha_struct *asd_ha,
80 return val; 79 return val;
81} 80}
82 81
83static inline u16 asd_read_word(struct asd_ha_struct *asd_ha, 82static u16 asd_read_word(struct asd_ha_struct *asd_ha,
84 unsigned long offs) 83 unsigned long offs)
85{ 84{
86 u16 val; 85 u16 val;
87 if (unlikely(asd_ha->iospace)) 86 if (unlikely(asd_ha->iospace))
@@ -93,8 +92,8 @@ static inline u16 asd_read_word(struct asd_ha_struct *asd_ha,
93 return val; 92 return val;
94} 93}
95 94
96static inline u32 asd_read_dword(struct asd_ha_struct *asd_ha, 95static u32 asd_read_dword(struct asd_ha_struct *asd_ha,
97 unsigned long offs) 96 unsigned long offs)
98{ 97{
99 u32 val; 98 u32 val;
100 if (unlikely(asd_ha->iospace)) 99 if (unlikely(asd_ha->iospace))
@@ -124,22 +123,22 @@ static inline u32 asd_mem_offs_swb(void)
124/* We know that the register wanted is in the range 123/* We know that the register wanted is in the range
125 * of the sliding window. 124 * of the sliding window.
126 */ 125 */
127#define ASD_READ_SW(ww, type, ord) \ 126#define ASD_READ_SW(ww, type, ord) \
128static inline type asd_read_##ww##_##ord (struct asd_ha_struct *asd_ha,\ 127static type asd_read_##ww##_##ord(struct asd_ha_struct *asd_ha, \
129 u32 reg) \ 128 u32 reg) \
130{ \ 129{ \
131 struct asd_ha_addrspace *io_handle = &asd_ha->io_handle[0]; \ 130 struct asd_ha_addrspace *io_handle = &asd_ha->io_handle[0]; \
132 u32 map_offs=(reg - io_handle-> ww##_base )+asd_mem_offs_##ww ();\ 131 u32 map_offs = (reg - io_handle->ww##_base) + asd_mem_offs_##ww();\
133 return asd_read_##ord (asd_ha, (unsigned long) map_offs); \ 132 return asd_read_##ord(asd_ha, (unsigned long)map_offs); \
134} 133}
135 134
136#define ASD_WRITE_SW(ww, type, ord) \ 135#define ASD_WRITE_SW(ww, type, ord) \
137static inline void asd_write_##ww##_##ord (struct asd_ha_struct *asd_ha,\ 136static void asd_write_##ww##_##ord(struct asd_ha_struct *asd_ha, \
138 u32 reg, type val) \ 137 u32 reg, type val) \
139{ \ 138{ \
140 struct asd_ha_addrspace *io_handle = &asd_ha->io_handle[0]; \ 139 struct asd_ha_addrspace *io_handle = &asd_ha->io_handle[0]; \
141 u32 map_offs=(reg - io_handle-> ww##_base )+asd_mem_offs_##ww ();\ 140 u32 map_offs = (reg - io_handle->ww##_base) + asd_mem_offs_##ww();\
142 asd_write_##ord (asd_ha, (unsigned long) map_offs, val); \ 141 asd_write_##ord(asd_ha, (unsigned long)map_offs, val); \
143} 142}
144 143
145ASD_READ_SW(swa, u8, byte); 144ASD_READ_SW(swa, u8, byte);
@@ -186,7 +185,7 @@ ASD_WRITE_SW(swc, u32, dword);
186 * @asd_ha: pointer to host adapter structure 185 * @asd_ha: pointer to host adapter structure
187 * @reg: register desired to be within range of the new window 186 * @reg: register desired to be within range of the new window
188 */ 187 */
189static inline void asd_move_swb(struct asd_ha_struct *asd_ha, u32 reg) 188static void asd_move_swb(struct asd_ha_struct *asd_ha, u32 reg)
190{ 189{
191 u32 base = reg & ~(MBAR0_SWB_SIZE-1); 190 u32 base = reg & ~(MBAR0_SWB_SIZE-1);
192 pci_write_config_dword(asd_ha->pcidev, PCI_CONF_MBAR0_SWB, base); 191 pci_write_config_dword(asd_ha->pcidev, PCI_CONF_MBAR0_SWB, base);
diff --git a/drivers/scsi/aic94xx/aic94xx_scb.c b/drivers/scsi/aic94xx/aic94xx_scb.c
index ab350504ca5a..46643319c520 100644
--- a/drivers/scsi/aic94xx/aic94xx_scb.c
+++ b/drivers/scsi/aic94xx/aic94xx_scb.c
@@ -50,7 +50,7 @@
50 | CURRENT_SPINUP_HOLD | CURRENT_GTO_TIMEOUT \ 50 | CURRENT_SPINUP_HOLD | CURRENT_GTO_TIMEOUT \
51 | CURRENT_OOB_ERROR) 51 | CURRENT_OOB_ERROR)
52 52
53static inline void get_lrate_mode(struct asd_phy *phy, u8 oob_mode) 53static void get_lrate_mode(struct asd_phy *phy, u8 oob_mode)
54{ 54{
55 struct sas_phy *sas_phy = phy->sas_phy.phy; 55 struct sas_phy *sas_phy = phy->sas_phy.phy;
56 56
@@ -81,7 +81,7 @@ static inline void get_lrate_mode(struct asd_phy *phy, u8 oob_mode)
81 phy->sas_phy.oob_mode = SATA_OOB_MODE; 81 phy->sas_phy.oob_mode = SATA_OOB_MODE;
82} 82}
83 83
84static inline void asd_phy_event_tasklet(struct asd_ascb *ascb, 84static void asd_phy_event_tasklet(struct asd_ascb *ascb,
85 struct done_list_struct *dl) 85 struct done_list_struct *dl)
86{ 86{
87 struct asd_ha_struct *asd_ha = ascb->ha; 87 struct asd_ha_struct *asd_ha = ascb->ha;
@@ -125,8 +125,7 @@ static inline void asd_phy_event_tasklet(struct asd_ascb *ascb,
125} 125}
126 126
127/* If phys are enabled sparsely, this will do the right thing. */ 127/* If phys are enabled sparsely, this will do the right thing. */
128static inline unsigned ord_phy(struct asd_ha_struct *asd_ha, 128static unsigned ord_phy(struct asd_ha_struct *asd_ha, struct asd_phy *phy)
129 struct asd_phy *phy)
130{ 129{
131 u8 enabled_mask = asd_ha->hw_prof.enabled_phys; 130 u8 enabled_mask = asd_ha->hw_prof.enabled_phys;
132 int i, k = 0; 131 int i, k = 0;
@@ -151,7 +150,7 @@ static inline unsigned ord_phy(struct asd_ha_struct *asd_ha,
151 * LOCKING: the frame_rcvd_lock needs to be held since this parses the frame 150 * LOCKING: the frame_rcvd_lock needs to be held since this parses the frame
152 * buffer. 151 * buffer.
153 */ 152 */
154static inline void asd_get_attached_sas_addr(struct asd_phy *phy, u8 *sas_addr) 153static void asd_get_attached_sas_addr(struct asd_phy *phy, u8 *sas_addr)
155{ 154{
156 if (phy->sas_phy.frame_rcvd[0] == 0x34 155 if (phy->sas_phy.frame_rcvd[0] == 0x34
157 && phy->sas_phy.oob_mode == SATA_OOB_MODE) { 156 && phy->sas_phy.oob_mode == SATA_OOB_MODE) {
@@ -232,9 +231,9 @@ static void asd_deform_port(struct asd_ha_struct *asd_ha, struct asd_phy *phy)
232 spin_unlock_irqrestore(&asd_ha->asd_ports_lock, flags); 231 spin_unlock_irqrestore(&asd_ha->asd_ports_lock, flags);
233} 232}
234 233
235static inline void asd_bytes_dmaed_tasklet(struct asd_ascb *ascb, 234static void asd_bytes_dmaed_tasklet(struct asd_ascb *ascb,
236 struct done_list_struct *dl, 235 struct done_list_struct *dl,
237 int edb_id, int phy_id) 236 int edb_id, int phy_id)
238{ 237{
239 unsigned long flags; 238 unsigned long flags;
240 int edb_el = edb_id + ascb->edb_index; 239 int edb_el = edb_id + ascb->edb_index;
@@ -255,9 +254,9 @@ static inline void asd_bytes_dmaed_tasklet(struct asd_ascb *ascb,
255 sas_ha->notify_port_event(&phy->sas_phy, PORTE_BYTES_DMAED); 254 sas_ha->notify_port_event(&phy->sas_phy, PORTE_BYTES_DMAED);
256} 255}
257 256
258static inline void asd_link_reset_err_tasklet(struct asd_ascb *ascb, 257static void asd_link_reset_err_tasklet(struct asd_ascb *ascb,
259 struct done_list_struct *dl, 258 struct done_list_struct *dl,
260 int phy_id) 259 int phy_id)
261{ 260{
262 struct asd_ha_struct *asd_ha = ascb->ha; 261 struct asd_ha_struct *asd_ha = ascb->ha;
263 struct sas_ha_struct *sas_ha = &asd_ha->sas_ha; 262 struct sas_ha_struct *sas_ha = &asd_ha->sas_ha;
@@ -308,9 +307,9 @@ out:
308 ; 307 ;
309} 308}
310 309
311static inline void asd_primitive_rcvd_tasklet(struct asd_ascb *ascb, 310static void asd_primitive_rcvd_tasklet(struct asd_ascb *ascb,
312 struct done_list_struct *dl, 311 struct done_list_struct *dl,
313 int phy_id) 312 int phy_id)
314{ 313{
315 unsigned long flags; 314 unsigned long flags;
316 struct sas_ha_struct *sas_ha = &ascb->ha->sas_ha; 315 struct sas_ha_struct *sas_ha = &ascb->ha->sas_ha;
@@ -715,7 +714,7 @@ out:
715 asd_ascb_free(ascb); 714 asd_ascb_free(ascb);
716} 715}
717 716
718static inline void set_speed_mask(u8 *speed_mask, struct asd_phy_desc *pd) 717static void set_speed_mask(u8 *speed_mask, struct asd_phy_desc *pd)
719{ 718{
720 /* disable all speeds, then enable defaults */ 719 /* disable all speeds, then enable defaults */
721 *speed_mask = SAS_SPEED_60_DIS | SAS_SPEED_30_DIS | SAS_SPEED_15_DIS 720 *speed_mask = SAS_SPEED_60_DIS | SAS_SPEED_30_DIS | SAS_SPEED_15_DIS
@@ -820,6 +819,8 @@ void asd_build_control_phy(struct asd_ascb *ascb, int phy_id, u8 subfunc)
820 819
821/* ---------- INITIATE LINK ADM TASK ---------- */ 820/* ---------- INITIATE LINK ADM TASK ---------- */
822 821
822#if 0
823
823static void link_adm_tasklet_complete(struct asd_ascb *ascb, 824static void link_adm_tasklet_complete(struct asd_ascb *ascb,
824 struct done_list_struct *dl) 825 struct done_list_struct *dl)
825{ 826{
@@ -852,6 +853,8 @@ void asd_build_initiate_link_adm_task(struct asd_ascb *ascb, int phy_id,
852 ascb->tasklet_complete = link_adm_tasklet_complete; 853 ascb->tasklet_complete = link_adm_tasklet_complete;
853} 854}
854 855
856#endif /* 0 */
857
855/* ---------- SCB timer ---------- */ 858/* ---------- SCB timer ---------- */
856 859
857/** 860/**
diff --git a/drivers/scsi/aic94xx/aic94xx_sds.c b/drivers/scsi/aic94xx/aic94xx_sds.c
index 2a4c933eb89c..4446e3d584dc 100644
--- a/drivers/scsi/aic94xx/aic94xx_sds.c
+++ b/drivers/scsi/aic94xx/aic94xx_sds.c
@@ -590,8 +590,8 @@ static int asd_reset_flash(struct asd_ha_struct *asd_ha)
590 return err; 590 return err;
591} 591}
592 592
593static inline int asd_read_flash_seg(struct asd_ha_struct *asd_ha, 593static int asd_read_flash_seg(struct asd_ha_struct *asd_ha,
594 void *buffer, u32 offs, int size) 594 void *buffer, u32 offs, int size)
595{ 595{
596 asd_read_reg_string(asd_ha, buffer, asd_ha->hw_prof.flash.bar+offs, 596 asd_read_reg_string(asd_ha, buffer, asd_ha->hw_prof.flash.bar+offs,
597 size); 597 size);
diff --git a/drivers/scsi/aic94xx/aic94xx_seq.c b/drivers/scsi/aic94xx/aic94xx_seq.c
index c750fbf7013b..f4272ac4c685 100644
--- a/drivers/scsi/aic94xx/aic94xx_seq.c
+++ b/drivers/scsi/aic94xx/aic94xx_seq.c
@@ -60,7 +60,7 @@ static u16 last_scb_site_no;
60 * 60 *
61 * Return 0 on success, negative on failure. 61 * Return 0 on success, negative on failure.
62 */ 62 */
63int asd_pause_cseq(struct asd_ha_struct *asd_ha) 63static int asd_pause_cseq(struct asd_ha_struct *asd_ha)
64{ 64{
65 int count = PAUSE_TRIES; 65 int count = PAUSE_TRIES;
66 u32 arp2ctl; 66 u32 arp2ctl;
@@ -87,7 +87,7 @@ int asd_pause_cseq(struct asd_ha_struct *asd_ha)
87 * 87 *
88 * Return 0 on success, negative on error. 88 * Return 0 on success, negative on error.
89 */ 89 */
90int asd_unpause_cseq(struct asd_ha_struct *asd_ha) 90static int asd_unpause_cseq(struct asd_ha_struct *asd_ha)
91{ 91{
92 u32 arp2ctl; 92 u32 arp2ctl;
93 int count = PAUSE_TRIES; 93 int count = PAUSE_TRIES;
@@ -115,7 +115,7 @@ int asd_unpause_cseq(struct asd_ha_struct *asd_ha)
115 * 115 *
116 * Return 0 on success, negative on error. 116 * Return 0 on success, negative on error.
117 */ 117 */
118static inline int asd_seq_pause_lseq(struct asd_ha_struct *asd_ha, int lseq) 118static int asd_seq_pause_lseq(struct asd_ha_struct *asd_ha, int lseq)
119{ 119{
120 u32 arp2ctl; 120 u32 arp2ctl;
121 int count = PAUSE_TRIES; 121 int count = PAUSE_TRIES;
@@ -143,7 +143,7 @@ static inline int asd_seq_pause_lseq(struct asd_ha_struct *asd_ha, int lseq)
143 * 143 *
144 * Return 0 on success, negative on failure. 144 * Return 0 on success, negative on failure.
145 */ 145 */
146int asd_pause_lseq(struct asd_ha_struct *asd_ha, u8 lseq_mask) 146static int asd_pause_lseq(struct asd_ha_struct *asd_ha, u8 lseq_mask)
147{ 147{
148 int lseq; 148 int lseq;
149 int err = 0; 149 int err = 0;
@@ -164,7 +164,7 @@ int asd_pause_lseq(struct asd_ha_struct *asd_ha, u8 lseq_mask)
164 * 164 *
165 * Return 0 on success, negative on error. 165 * Return 0 on success, negative on error.
166 */ 166 */
167static inline int asd_seq_unpause_lseq(struct asd_ha_struct *asd_ha, int lseq) 167static int asd_seq_unpause_lseq(struct asd_ha_struct *asd_ha, int lseq)
168{ 168{
169 u32 arp2ctl; 169 u32 arp2ctl;
170 int count = PAUSE_TRIES; 170 int count = PAUSE_TRIES;
@@ -186,27 +186,6 @@ static inline int asd_seq_unpause_lseq(struct asd_ha_struct *asd_ha, int lseq)
186} 186}
187 187
188 188
189/**
190 * asd_unpause_lseq - unpause the link sequencer(s)
191 * @asd_ha: pointer to host adapter structure
192 * @lseq_mask: mask of link sequencers of interest
193 *
194 * Return 0 on success, negative on failure.
195 */
196int asd_unpause_lseq(struct asd_ha_struct *asd_ha, u8 lseq_mask)
197{
198 int lseq;
199 int err = 0;
200
201 for_each_sequencer(lseq_mask, lseq_mask, lseq) {
202 err = asd_seq_unpause_lseq(asd_ha, lseq);
203 if (err)
204 return err;
205 }
206
207 return err;
208}
209
210/* ---------- Downloading CSEQ/LSEQ microcode ---------- */ 189/* ---------- Downloading CSEQ/LSEQ microcode ---------- */
211 190
212static int asd_verify_cseq(struct asd_ha_struct *asd_ha, const u8 *_prog, 191static int asd_verify_cseq(struct asd_ha_struct *asd_ha, const u8 *_prog,
diff --git a/drivers/scsi/aic94xx/aic94xx_seq.h b/drivers/scsi/aic94xx/aic94xx_seq.h
index 2ea6a0d52208..ad787c55525f 100644
--- a/drivers/scsi/aic94xx/aic94xx_seq.h
+++ b/drivers/scsi/aic94xx/aic94xx_seq.h
@@ -58,10 +58,6 @@ struct sequencer_file_header {
58} __attribute__((packed)); 58} __attribute__((packed));
59 59
60#ifdef __KERNEL__ 60#ifdef __KERNEL__
61int asd_pause_cseq(struct asd_ha_struct *asd_ha);
62int asd_unpause_cseq(struct asd_ha_struct *asd_ha);
63int asd_pause_lseq(struct asd_ha_struct *asd_ha, u8 lseq_mask);
64int asd_unpause_lseq(struct asd_ha_struct *asd_ha, u8 lseq_mask);
65int asd_init_seqs(struct asd_ha_struct *asd_ha); 61int asd_init_seqs(struct asd_ha_struct *asd_ha);
66int asd_start_seqs(struct asd_ha_struct *asd_ha); 62int asd_start_seqs(struct asd_ha_struct *asd_ha);
67int asd_release_firmware(void); 63int asd_release_firmware(void);
diff --git a/drivers/scsi/aic94xx/aic94xx_task.c b/drivers/scsi/aic94xx/aic94xx_task.c
index 008df9ab92a5..326765c9caf8 100644
--- a/drivers/scsi/aic94xx/aic94xx_task.c
+++ b/drivers/scsi/aic94xx/aic94xx_task.c
@@ -33,7 +33,7 @@ static void asd_unbuild_ata_ascb(struct asd_ascb *a);
33static void asd_unbuild_smp_ascb(struct asd_ascb *a); 33static void asd_unbuild_smp_ascb(struct asd_ascb *a);
34static void asd_unbuild_ssp_ascb(struct asd_ascb *a); 34static void asd_unbuild_ssp_ascb(struct asd_ascb *a);
35 35
36static inline void asd_can_dequeue(struct asd_ha_struct *asd_ha, int num) 36static void asd_can_dequeue(struct asd_ha_struct *asd_ha, int num)
37{ 37{
38 unsigned long flags; 38 unsigned long flags;
39 39
@@ -51,9 +51,9 @@ static const u8 data_dir_flags[] = {
51 [PCI_DMA_NONE] = DATA_DIR_NONE, /* NO TRANSFER */ 51 [PCI_DMA_NONE] = DATA_DIR_NONE, /* NO TRANSFER */
52}; 52};
53 53
54static inline int asd_map_scatterlist(struct sas_task *task, 54static int asd_map_scatterlist(struct sas_task *task,
55 struct sg_el *sg_arr, 55 struct sg_el *sg_arr,
56 gfp_t gfp_flags) 56 gfp_t gfp_flags)
57{ 57{
58 struct asd_ascb *ascb = task->lldd_task; 58 struct asd_ascb *ascb = task->lldd_task;
59 struct asd_ha_struct *asd_ha = ascb->ha; 59 struct asd_ha_struct *asd_ha = ascb->ha;
@@ -131,7 +131,7 @@ err_unmap:
131 return res; 131 return res;
132} 132}
133 133
134static inline void asd_unmap_scatterlist(struct asd_ascb *ascb) 134static void asd_unmap_scatterlist(struct asd_ascb *ascb)
135{ 135{
136 struct asd_ha_struct *asd_ha = ascb->ha; 136 struct asd_ha_struct *asd_ha = ascb->ha;
137 struct sas_task *task = ascb->uldd_task; 137 struct sas_task *task = ascb->uldd_task;
@@ -527,7 +527,7 @@ static void asd_unbuild_ssp_ascb(struct asd_ascb *a)
527 527
528/* ---------- Execute Task ---------- */ 528/* ---------- Execute Task ---------- */
529 529
530static inline int asd_can_queue(struct asd_ha_struct *asd_ha, int num) 530static int asd_can_queue(struct asd_ha_struct *asd_ha, int num)
531{ 531{
532 int res = 0; 532 int res = 0;
533 unsigned long flags; 533 unsigned long flags;
diff --git a/drivers/scsi/aic94xx/aic94xx_tmf.c b/drivers/scsi/aic94xx/aic94xx_tmf.c
index b9ac8f703a1d..633ff40c736a 100644
--- a/drivers/scsi/aic94xx/aic94xx_tmf.c
+++ b/drivers/scsi/aic94xx/aic94xx_tmf.c
@@ -336,7 +336,7 @@ static void asd_tmf_tasklet_complete(struct asd_ascb *ascb,
336 asd_ascb_free(ascb); 336 asd_ascb_free(ascb);
337} 337}
338 338
339static inline int asd_clear_nexus(struct sas_task *task) 339static int asd_clear_nexus(struct sas_task *task)
340{ 340{
341 int res = TMF_RESP_FUNC_FAILED; 341 int res = TMF_RESP_FUNC_FAILED;
342 int leftover; 342 int leftover;