[PATCH] drivers/scsi/initio.c: cleanups

This patch contains the following cleanups:
- make needlessly global code static
- remove or #if 0 the following unused functions:
- tul_pop_pend_scb
- tul_device_reset
- tul_reset_scsi_bus

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Adrian Bunk and committed by Linus Torvalds a2ba192c 09417379

+36 -67
+36 -49
drivers/scsi/initio.c
··· 223 static void tul_select_atn3(HCS * pCurHcb, SCB * pCurScb); 224 static void tul_select_atn_stop(HCS * pCurHcb, SCB * pCurScb); 225 static int int_tul_busfree(HCS * pCurHcb); 226 - int int_tul_scsi_rst(HCS * pCurHcb); 227 static int int_tul_bad_seq(HCS * pCurHcb); 228 static int int_tul_resel(HCS * pCurHcb); 229 static int tul_sync_done(HCS * pCurHcb); ··· 240 static void tul_se2_update_all(WORD CurBase); /* setup default pattern */ 241 static void tul_read_eeprom(WORD CurBase); 242 243 - /* ---- EXTERNAL VARIABLES ---- */ 244 - HCS tul_hcs[MAX_SUPPORTED_ADAPTERS]; 245 /* ---- INTERNAL VARIABLES ---- */ 246 static INI_ADPT_STRUCT i91u_adpt[MAX_SUPPORTED_ADAPTERS]; 247 248 /*NVRAM nvram, *nvramp = &nvram; */ ··· 380 381 382 ******************************************************************/ 383 - void tul_se2_instr(WORD CurBase, UCHAR instr) 384 { 385 int i; 386 UCHAR b; ··· 436 Input :address of Serial E2PROM 437 Output :value stored in Serial E2PROM 438 *******************************************************************/ 439 - USHORT tul_se2_rd(WORD CurBase, ULONG adr) 440 { 441 UCHAR instr, readByte; 442 USHORT readWord; ··· 467 /****************************************************************** 468 Input: new value in Serial E2PROM, address of Serial E2PROM 469 *******************************************************************/ 470 - void tul_se2_wr(WORD CurBase, UCHAR adr, USHORT writeWord) 471 { 472 UCHAR readByte; 473 UCHAR instr; ··· 583 TUL_WR(CurBase + TUL_GCTRL, gctrl & ~TUL_GCTRL_EEPROM_BIT); 584 } /* read_eeprom */ 585 586 - int Addi91u_into_Adapter_table(WORD wBIOS, WORD wBASE, BYTE bInterrupt, 587 - BYTE bBus, BYTE bDevice) 588 { 589 int i, j; 590 ··· 615 return 1; 616 } 617 618 - void init_i91uAdapter_table(void) 619 { 620 int i; 621 ··· 629 return; 630 } 631 632 - void tul_stop_bm(HCS * pCurHcb) 633 { 634 635 if (TUL_RD(pCurHcb->HCS_Base, TUL_XStatus) & XPEND) { /* if DMA xfer is pending, abort DMA xfer */ ··· 641 } 642 643 /***************************************************************************/ 644 - void get_tulipPCIConfig(HCS * pCurHcb, int ch_idx) 645 { 646 pCurHcb->HCS_Base = i91u_adpt[ch_idx].ADPT_BASE; /* Supply base address */ 647 pCurHcb->HCS_BIOS = i91u_adpt[ch_idx].ADPT_BIOS; /* Supply BIOS address */ ··· 650 } 651 652 /***************************************************************************/ 653 - int tul_reset_scsi(HCS * pCurHcb, int seconds) 654 { 655 TUL_WR(pCurHcb->HCS_Base + TUL_SCtrl0, TSC_RST_BUS); 656 ··· 669 } 670 671 /***************************************************************************/ 672 - int init_tulip(HCS * pCurHcb, SCB * scbp, int tul_num_scb, BYTE * pbBiosAdr, int seconds) 673 { 674 int i; 675 BYTE *pwFlags; ··· 788 } 789 790 /***************************************************************************/ 791 - SCB *tul_alloc_scb(HCS * hcsp) 792 { 793 SCB *pTmpScb; 794 ULONG flags; ··· 807 } 808 809 /***************************************************************************/ 810 - void tul_release_scb(HCS * hcsp, SCB * scbp) 811 { 812 ULONG flags; 813 ··· 829 } 830 831 /***************************************************************************/ 832 - void tul_append_pend_scb(HCS * pCurHcb, SCB * scbp) 833 { 834 835 #if DEBUG_QUEUE ··· 847 } 848 849 /***************************************************************************/ 850 - void tul_push_pend_scb(HCS * pCurHcb, SCB * scbp) 851 { 852 853 #if DEBUG_QUEUE ··· 863 } 864 865 /***************************************************************************/ 866 - SCB *tul_find_first_pend_scb(HCS * pCurHcb) 867 { 868 SCB *pFirstPend; 869 ··· 894 return (pFirstPend); 895 } 896 /***************************************************************************/ 897 - SCB *tul_pop_pend_scb(HCS * pCurHcb) 898 - { 899 - SCB *pTmpScb; 900 - 901 - if ((pTmpScb = pCurHcb->HCS_FirstPend) != NULL) { 902 - if ((pCurHcb->HCS_FirstPend = pTmpScb->SCB_NxtScb) == NULL) 903 - pCurHcb->HCS_LastPend = NULL; 904 - pTmpScb->SCB_NxtScb = NULL; 905 - } 906 - #if DEBUG_QUEUE 907 - printk("Pop pend SCB %lx; ", (ULONG) pTmpScb); 908 - #endif 909 - return (pTmpScb); 910 - } 911 - 912 - 913 - /***************************************************************************/ 914 - void tul_unlink_pend_scb(HCS * pCurHcb, SCB * pCurScb) 915 { 916 SCB *pTmpScb, *pPrevScb; 917 ··· 922 return; 923 } 924 /***************************************************************************/ 925 - void tul_append_busy_scb(HCS * pCurHcb, SCB * scbp) 926 { 927 928 #if DEBUG_QUEUE ··· 944 } 945 946 /***************************************************************************/ 947 - SCB *tul_pop_busy_scb(HCS * pCurHcb) 948 { 949 SCB *pTmpScb; 950 ··· 965 } 966 967 /***************************************************************************/ 968 - void tul_unlink_busy_scb(HCS * pCurHcb, SCB * pCurScb) 969 { 970 SCB *pTmpScb, *pPrevScb; 971 ··· 1020 } 1021 1022 /***************************************************************************/ 1023 - void tul_append_done_scb(HCS * pCurHcb, SCB * scbp) 1024 { 1025 1026 #if DEBUG_QUEUE ··· 1056 } 1057 1058 /***************************************************************************/ 1059 - int tul_abort_srb(HCS * pCurHcb, struct scsi_cmnd *srbp) 1060 { 1061 ULONG flags; 1062 SCB *pTmpScb, *pPrevScb; ··· 1146 } 1147 1148 /***************************************************************************/ 1149 - int tul_bad_seq(HCS * pCurHcb) 1150 { 1151 SCB *pCurScb; 1152 ··· 1165 return (tul_post_scsi_rst(pCurHcb)); 1166 } 1167 1168 /************************************************************************/ 1169 - int tul_device_reset(HCS * pCurHcb, struct scsi_cmnd *pSrb, 1170 - unsigned int target, unsigned int ResetFlags) 1171 { 1172 ULONG flags; 1173 SCB *pScb; ··· 1240 return SCSI_RESET_PENDING; 1241 } 1242 1243 - int tul_reset_scsi_bus(HCS * pCurHcb) 1244 { 1245 ULONG flags; 1246 ··· 1269 return (SCSI_RESET_SUCCESS | SCSI_RESET_HOST_RESET); 1270 } 1271 1272 /************************************************************************/ 1273 - void tul_exec_scb(HCS * pCurHcb, SCB * pCurScb) 1274 { 1275 ULONG flags; 1276 ··· 1305 } 1306 1307 /***************************************************************************/ 1308 - int tul_isr(HCS * pCurHcb) 1309 { 1310 /* Enter critical section */ 1311 ··· 2095 2096 /***************************************************************************/ 2097 /* scsi bus reset */ 2098 - int int_tul_scsi_rst(HCS * pCurHcb) 2099 { 2100 SCB *pCurScb; 2101 int i; ··· 2201 2202 2203 /***************************************************************************/ 2204 - int int_tul_bad_seq(HCS * pCurHcb) 2205 { /* target wrong phase */ 2206 SCB *pCurScb; 2207 int i;
··· 223 static void tul_select_atn3(HCS * pCurHcb, SCB * pCurScb); 224 static void tul_select_atn_stop(HCS * pCurHcb, SCB * pCurScb); 225 static int int_tul_busfree(HCS * pCurHcb); 226 + static int int_tul_scsi_rst(HCS * pCurHcb); 227 static int int_tul_bad_seq(HCS * pCurHcb); 228 static int int_tul_resel(HCS * pCurHcb); 229 static int tul_sync_done(HCS * pCurHcb); ··· 240 static void tul_se2_update_all(WORD CurBase); /* setup default pattern */ 241 static void tul_read_eeprom(WORD CurBase); 242 243 /* ---- INTERNAL VARIABLES ---- */ 244 + static HCS tul_hcs[MAX_SUPPORTED_ADAPTERS]; 245 static INI_ADPT_STRUCT i91u_adpt[MAX_SUPPORTED_ADAPTERS]; 246 247 /*NVRAM nvram, *nvramp = &nvram; */ ··· 381 382 383 ******************************************************************/ 384 + static void tul_se2_instr(WORD CurBase, UCHAR instr) 385 { 386 int i; 387 UCHAR b; ··· 437 Input :address of Serial E2PROM 438 Output :value stored in Serial E2PROM 439 *******************************************************************/ 440 + static USHORT tul_se2_rd(WORD CurBase, ULONG adr) 441 { 442 UCHAR instr, readByte; 443 USHORT readWord; ··· 468 /****************************************************************** 469 Input: new value in Serial E2PROM, address of Serial E2PROM 470 *******************************************************************/ 471 + static void tul_se2_wr(WORD CurBase, UCHAR adr, USHORT writeWord) 472 { 473 UCHAR readByte; 474 UCHAR instr; ··· 584 TUL_WR(CurBase + TUL_GCTRL, gctrl & ~TUL_GCTRL_EEPROM_BIT); 585 } /* read_eeprom */ 586 587 + static int Addi91u_into_Adapter_table(WORD wBIOS, WORD wBASE, BYTE bInterrupt, 588 + BYTE bBus, BYTE bDevice) 589 { 590 int i, j; 591 ··· 616 return 1; 617 } 618 619 + static void init_i91uAdapter_table(void) 620 { 621 int i; 622 ··· 630 return; 631 } 632 633 + static void tul_stop_bm(HCS * pCurHcb) 634 { 635 636 if (TUL_RD(pCurHcb->HCS_Base, TUL_XStatus) & XPEND) { /* if DMA xfer is pending, abort DMA xfer */ ··· 642 } 643 644 /***************************************************************************/ 645 + static void get_tulipPCIConfig(HCS * pCurHcb, int ch_idx) 646 { 647 pCurHcb->HCS_Base = i91u_adpt[ch_idx].ADPT_BASE; /* Supply base address */ 648 pCurHcb->HCS_BIOS = i91u_adpt[ch_idx].ADPT_BIOS; /* Supply BIOS address */ ··· 651 } 652 653 /***************************************************************************/ 654 + static int tul_reset_scsi(HCS * pCurHcb, int seconds) 655 { 656 TUL_WR(pCurHcb->HCS_Base + TUL_SCtrl0, TSC_RST_BUS); 657 ··· 670 } 671 672 /***************************************************************************/ 673 + static int init_tulip(HCS * pCurHcb, SCB * scbp, int tul_num_scb, 674 + BYTE * pbBiosAdr, int seconds) 675 { 676 int i; 677 BYTE *pwFlags; ··· 788 } 789 790 /***************************************************************************/ 791 + static SCB *tul_alloc_scb(HCS * hcsp) 792 { 793 SCB *pTmpScb; 794 ULONG flags; ··· 807 } 808 809 /***************************************************************************/ 810 + static void tul_release_scb(HCS * hcsp, SCB * scbp) 811 { 812 ULONG flags; 813 ··· 829 } 830 831 /***************************************************************************/ 832 + static void tul_append_pend_scb(HCS * pCurHcb, SCB * scbp) 833 { 834 835 #if DEBUG_QUEUE ··· 847 } 848 849 /***************************************************************************/ 850 + static void tul_push_pend_scb(HCS * pCurHcb, SCB * scbp) 851 { 852 853 #if DEBUG_QUEUE ··· 863 } 864 865 /***************************************************************************/ 866 + static SCB *tul_find_first_pend_scb(HCS * pCurHcb) 867 { 868 SCB *pFirstPend; 869 ··· 894 return (pFirstPend); 895 } 896 /***************************************************************************/ 897 + static void tul_unlink_pend_scb(HCS * pCurHcb, SCB * pCurScb) 898 { 899 SCB *pTmpScb, *pPrevScb; 900 ··· 939 return; 940 } 941 /***************************************************************************/ 942 + static void tul_append_busy_scb(HCS * pCurHcb, SCB * scbp) 943 { 944 945 #if DEBUG_QUEUE ··· 961 } 962 963 /***************************************************************************/ 964 + static SCB *tul_pop_busy_scb(HCS * pCurHcb) 965 { 966 SCB *pTmpScb; 967 ··· 982 } 983 984 /***************************************************************************/ 985 + static void tul_unlink_busy_scb(HCS * pCurHcb, SCB * pCurScb) 986 { 987 SCB *pTmpScb, *pPrevScb; 988 ··· 1037 } 1038 1039 /***************************************************************************/ 1040 + static void tul_append_done_scb(HCS * pCurHcb, SCB * scbp) 1041 { 1042 1043 #if DEBUG_QUEUE ··· 1073 } 1074 1075 /***************************************************************************/ 1076 + static int tul_abort_srb(HCS * pCurHcb, struct scsi_cmnd *srbp) 1077 { 1078 ULONG flags; 1079 SCB *pTmpScb, *pPrevScb; ··· 1163 } 1164 1165 /***************************************************************************/ 1166 + static int tul_bad_seq(HCS * pCurHcb) 1167 { 1168 SCB *pCurScb; 1169 ··· 1182 return (tul_post_scsi_rst(pCurHcb)); 1183 } 1184 1185 + #if 0 1186 + 1187 /************************************************************************/ 1188 + static int tul_device_reset(HCS * pCurHcb, struct scsi_cmnd *pSrb, 1189 + unsigned int target, unsigned int ResetFlags) 1190 { 1191 ULONG flags; 1192 SCB *pScb; ··· 1255 return SCSI_RESET_PENDING; 1256 } 1257 1258 + static int tul_reset_scsi_bus(HCS * pCurHcb) 1259 { 1260 ULONG flags; 1261 ··· 1284 return (SCSI_RESET_SUCCESS | SCSI_RESET_HOST_RESET); 1285 } 1286 1287 + #endif /* 0 */ 1288 + 1289 /************************************************************************/ 1290 + static void tul_exec_scb(HCS * pCurHcb, SCB * pCurScb) 1291 { 1292 ULONG flags; 1293 ··· 1318 } 1319 1320 /***************************************************************************/ 1321 + static int tul_isr(HCS * pCurHcb) 1322 { 1323 /* Enter critical section */ 1324 ··· 2108 2109 /***************************************************************************/ 2110 /* scsi bus reset */ 2111 + static int int_tul_scsi_rst(HCS * pCurHcb) 2112 { 2113 SCB *pCurScb; 2114 int i; ··· 2214 2215 2216 /***************************************************************************/ 2217 + static int int_tul_bad_seq(HCS * pCurHcb) 2218 { /* target wrong phase */ 2219 SCB *pCurScb; 2220 int i;
-18
drivers/scsi/initio.h
··· 719 #define SCSI_RESET_HOST_RESET 0x200 720 #define SCSI_RESET_ACTION 0xff 721 722 - extern void init_i91uAdapter_table(void); 723 - extern int Addi91u_into_Adapter_table(WORD, WORD, BYTE, BYTE, BYTE); 724 - extern int tul_ReturnNumberOfAdapters(void); 725 - extern void get_tulipPCIConfig(HCS * pHCB, int iChannel_index); 726 - extern int init_tulip(HCS * pHCB, SCB * pSCB, int tul_num_scb, BYTE * pbBiosAdr, int reset_time); 727 - extern SCB *tul_alloc_scb(HCS * pHCB); 728 - extern int tul_abort_srb(HCS * pHCB, struct scsi_cmnd * pSRB); 729 - extern void tul_exec_scb(HCS * pHCB, SCB * pSCB); 730 - extern void tul_release_scb(HCS * pHCB, SCB * pSCB); 731 - extern void tul_stop_bm(HCS * pHCB); 732 - extern int tul_reset_scsi(HCS * pCurHcb, int seconds); 733 - extern int tul_isr(HCS * pHCB); 734 - extern int tul_reset(HCS * pHCB, struct scsi_cmnd * pSRB, unsigned char target); 735 - extern int tul_reset_scsi_bus(HCS * pCurHcb); 736 - extern int tul_device_reset(HCS * pCurHcb, struct scsi_cmnd *pSrb, 737 - unsigned int target, unsigned int ResetFlags); 738 - /* ---- EXTERNAL VARIABLES ---- */ 739 - extern HCS tul_hcs[];
··· 719 #define SCSI_RESET_HOST_RESET 0x200 720 #define SCSI_RESET_ACTION 0xff 721