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