scsi: remove several unused functions
Subsystems (6)
PATCH 1/1 scsi: remove several unused functions
--- drivers/scsi/aic7xxx/aic79xx_core.c | 89 --------------------------- drivers/scsi/aic7xxx/aic79xx_inline.h | 10 --- drivers/scsi/aic7xxx/aic79xx_osm.c | 16 ----- drivers/scsi/aic7xxx/aic7xxx_core.c | 35 ----------- drivers/scsi/nsp32.c | 14 ----- drivers/scsi/ses.c | 19 ------ 6 files changed, 183 deletions(-)
drivers/scsi/aic7xxx/aic79xx_core.c +0 -89
@@ -659,28 +659,12 @@ ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr)ahd_outb (ahd,SCBPTR +1 , (scbptr >>8 ) &0xFF ); } -#if 0 /* unused */ -static u_int -ahd_get_hnscb_qoff (struct ahd_softc *ahd) -{ -return (ahd_inw_atomic (ahd,HNSCB_QOFF )); -} -#endif -static void ahd_set_hnscb_qoff (struct ahd_softc *ahd,u_int value) {ahd_outw_atomic (ahd,HNSCB_QOFF , value); } -#if 0 /* unused */ -static u_int -ahd_get_hescb_qoff (struct ahd_softc *ahd) -{ -return (ahd_inb (ahd,HESCB_QOFF )); -} -#endif -static void ahd_set_hescb_qoff (struct ahd_softc *ahd,u_int value) {
@@ -705,15 +689,6 @@ ahd_set_snscb_qoff(struct ahd_softc *ahd, u_int value)ahd_outw (ahd,SNSCB_QOFF , value); } -#if 0 /* unused */ -static u_int -ahd_get_sescb_qoff (struct ahd_softc *ahd) -{ -AHD_ASSERT_MODES (ahd,AHD_MODE_CCHAN_MSK ,AHD_MODE_CCHAN_MSK ); -return (ahd_inb (ahd,SESCB_QOFF )); -} -#endif -static void ahd_set_sescb_qoff (struct ahd_softc *ahd,u_int value) {
@@ -721,15 +696,6 @@ ahd_set_sescb_qoff(struct ahd_softc *ahd, u_int value)ahd_outb (ahd,SESCB_QOFF , value); } -#if 0 /* unused */ -static u_int -ahd_get_sdscb_qoff (struct ahd_softc *ahd) -{ -AHD_ASSERT_MODES (ahd,AHD_MODE_CCHAN_MSK ,AHD_MODE_CCHAN_MSK ); -return (ahd_inb (ahd,SDSCB_QOFF ) | (ahd_inb (ahd,SDSCB_QOFF +1 ) <<8 )); -} -#endif -static void ahd_set_sdscb_qoff (struct ahd_softc *ahd,u_int value) {
@@ -3560,33 +3526,6 @@ ahd_clear_intstat(struct ahd_softc *ahd)uint32_t ahd_debug =AHD_DEBUG_OPTS ;#endif -#if 0 -void -ahd_print_scb (struct scb *scb) -{ -struct hardware_scb *hscb; -int i; - - hscb = scb->hscb; -printk ("scb:%p control:0x%x scsiid:0x%x lun:%d cdb_len:%d\n" , - (void *)scb, - hscb->control, - hscb->scsiid, - hscb->lun, - hscb->cdb_len); -printk ("Shared Data: " ); -for (i =0 ; i <sizeof (hscb->shared_data.idata.cdb); i++) -printk ("%#02x" , hscb->shared_data.idata.cdb[i]); -printk (" dataptr:%#x%x datacnt:%#x sgptr:%#x tag:%#x\n" , - (uint32_t )((ahd_le64toh (hscb->dataptr) >>32 ) &0xFFFFFFFF ), - (uint32_t )(ahd_le64toh (hscb->dataptr) &0xFFFFFFFF ), -ahd_le32toh (hscb->datacnt), -ahd_le32toh (hscb->sgptr), -SCB_GET_TAG (scb)); -ahd_dump_sglist (scb); -} -#endif /* 0 */ -/************************* Transfer Negotiation *******************************/ /* * Allocate per target mode instance (ID we respond to as a target)
@@ -9889,34 +9828,6 @@ ahd_dump_card_state(struct ahd_softc *ahd)ahd_unpause (ahd); } -#if 0 -void -ahd_dump_scbs (struct ahd_softc *ahd) -{ -ahd_mode_state saved_modes; -u_int saved_scb_index; -int i; - - saved_modes =ahd_save_modes (ahd); -ahd_set_modes (ahd,AHD_MODE_SCSI ,AHD_MODE_SCSI ); - saved_scb_index =ahd_get_scbptr (ahd); -for (i =0 ; i <AHD_SCB_MAX ; i++) { -ahd_set_scbptr (ahd, i); -printk ("%3d" , i); -printk ("(CTRL 0x%x ID 0x%x N 0x%x N2 0x%x SG 0x%x, RSG 0x%x)\n" , -ahd_inb_scbram (ahd,SCB_CONTROL ), -ahd_inb_scbram (ahd,SCB_SCSIID ), -ahd_inw_scbram (ahd,SCB_NEXT ), -ahd_inw_scbram (ahd,SCB_NEXT2 ), -ahd_inl_scbram (ahd,SCB_SGPTR ), -ahd_inl_scbram (ahd,SCB_RESIDUAL_SGPTR )); - } -printk ("\n" ); -ahd_set_scbptr (ahd, saved_scb_index); -ahd_restore_modes (ahd, saved_modes); -} -#endif /* 0 */ -/**************************** Flexport Logic **********************************/ /* * Read count 16bit words from 16bit word address start_addr from the
drivers/scsi/aic7xxx/aic79xx_inline.h +0 -10
@@ -144,16 +144,6 @@ static inline uint8_t *ahd_get_sense_buf(struct ahd_softc *ahd,static inline uint32_t ahd_get_sense_bufaddr (struct ahd_softc *ahd,struct scb *scb); -#if 0 /* unused */ - -#define AHD_COPY_COL_IDX (dst, src) \ -do { \ - dst->hscb->scsiid = src->hscb->scsiid; \ - dst->hscb->lun = src->hscb->lun; \ -} while (0) - -#endif -static inline uint8_t *ahd_get_sense_buf (struct ahd_softc *ahd,struct scb *scb) {
drivers/scsi/aic7xxx/aic79xx_osm.c +0 -16
@@ -411,22 +411,6 @@ ahd_inb(struct ahd_softc * ahd, long port)return (x); } -#if 0 /* unused */ -static uint16_t -ahd_inw_atomic (struct ahd_softc * ahd,long port) -{ -uint8_t x; - -if (ahd->tags[0 ] ==BUS_SPACE_MEMIO ) { - x =readw (ahd->bshs[0 ].maddr + port); - }else { - x =inw (ahd->bshs[(port) >>8 ].ioport + ((port) &0xFF )); - } -mb (); -return (x); -} -#endif -void ahd_outb (struct ahd_softc * ahd,long port,uint8_t val) {
drivers/scsi/aic7xxx/aic7xxx_core.c +0 -35
@@ -2072,41 +2072,6 @@ ahc_clear_intstat(struct ahc_softc *ahc)uint32_t ahc_debug =AHC_DEBUG_OPTS ;#endif -#if 0 /* unused */ -static void -ahc_print_scb (struct scb *scb) -{ -int i; - -struct hardware_scb *hscb = scb->hscb; - -printk ("scb:%p control:0x%x scsiid:0x%x lun:%d cdb_len:%d\n" , - (void *)scb, - hscb->control, - hscb->scsiid, - hscb->lun, - hscb->cdb_len); -printk ("Shared Data: " ); -for (i =0 ; i <sizeof (hscb->shared_data.cdb); i++) -printk ("%#02x" , hscb->shared_data.cdb[i]); -printk (" dataptr:%#x datacnt:%#x sgptr:%#x tag:%#x\n" , -ahc_le32toh (hscb->dataptr), -ahc_le32toh (hscb->datacnt), -ahc_le32toh (hscb->sgptr), - hscb->tag); -if (scb->sg_count >0 ) { -for (i =0 ; i < scb->sg_count; i++) { -printk ("sg[%d] - Addr 0x%x%x : Length %d\n" , - i, - (ahc_le32toh (scb->sg_list[i].len) >>24 - &SG_HIGH_ADDR_BITS ), -ahc_le32toh (scb->sg_list[i].addr), -ahc_le32toh (scb->sg_list[i].len)); - } - } -} -#endif -/************************* Transfer Negotiation *******************************/ /* * Allocate per target mode instance (ID we respond to as a target)
drivers/scsi/nsp32.c +0 -14
@@ -427,20 +427,6 @@ static void nsp32_build_reject(struct scsi_cmnd *SCpnt)/* * timer */ -#if 0 -static void nsp32_start_timer (struct scsi_cmnd *SCpnt,int time) -{ -unsigned int base = SCpnt->host->io_port; - -nsp32_dbg (NSP32_DEBUG_INTR ,"timer=%d" , time); - -if (time & (~TIMER_CNT_MASK )) { -nsp32_dbg (NSP32_DEBUG_INTR ,"timer set overflow" ); - } - -nsp32_write2 (base,TIMER_SET , time &TIMER_CNT_MASK ); -} -#endif /*
drivers/scsi/ses.c +0 -19
@@ -446,25 +446,6 @@ struct ses_host_edev {struct enclosure_device *edev; }; -#if 0 -int ses_match_host (struct enclosure_device *edev,void *data) -{ -struct ses_host_edev *sed = data; -struct scsi_device *sdev; - -if (!scsi_is_sdev_device (edev->edev.parent)) -return 0 ; - - sdev =to_scsi_device (edev->edev.parent); - -if (sdev->host != sed->shost) -return 0 ; - - sed->edev = edev; -return 1 ; -} -#endif /* 0 */ -static int ses_process_descriptor (struct enclosure_component *ecomp,unsigned char *desc,int max_desc_len) {
Signature · 1 line
2.43.0
PATCH 1/2 scsi: sym53c8xx_2: remove conditional statements for constant macros
This makes the code easier to understand and maintain. There is more unused code to remove, but this takes care of some low-hanging fruit. The changes were mostly done via unifdef.
--- drivers/scsi/ncr53c8xx.c | 17 ------- drivers/scsi/sym53c8xx_2/sym53c8xx.h | 30 ------------ drivers/scsi/sym53c8xx_2/sym_fw.c | 10 ---- drivers/scsi/sym53c8xx_2/sym_glue.c | 40 ---------------- drivers/scsi/sym53c8xx_2/sym_hipd.c | 72 +--------------------------- drivers/scsi/sym53c8xx_2/sym_hipd.h | 16 +------ drivers/scsi/sym53c8xx_2/sym_nvram.h | 16 ------- 7 files changed, 3 insertions(+), 198 deletions(-)
drivers/scsi/ncr53c8xx.c +0 -17
@@ -7029,14 +7029,6 @@ static struct ccb *ncr_get_ccb(struct ncb *np, struct scsi_cmnd *cmd)/* ** Wait until available. */ -#if 0 -while (cp->magic) { -if (flags &SCSI_NOSLEEP )break ; -if (tsleep ((caddr_t )cp,PRIBIO |PCATCH ,"ncr" ,0 )) -break ; - } -#endif -if (cp->magic)return NULL ;
@@ -7124,11 +7116,6 @@ static void ncr_free_ccb (struct ncb *np, struct ccb *cp) --np->queuedccbs; cp->queued =0 ; } - -#if 0 -if (cp == np->ccb) -wakeup ((caddr_t ) cp); -#endif }
@@ -7524,11 +7511,7 @@ static int __init ncr_regtest (struct ncb* np) data =0xffffffff ;OUTL_OFF (offsetof(struct ncr_reg , nc_dstat), data); data =INL_OFF (offsetof(struct ncr_reg , nc_dstat)); -#if 1 if (data ==0xffffffff ) { -#else -if ((data &0xe2f0fffd ) !=0x02000080 ) { -#endif printk ("CACHE TEST FAILED: reg dstat-sstat2 readback %x.\n" , (unsigned ) data);return (0x10 );
drivers/scsi/sym53c8xx_2/sym53c8xx.h +0 -30
@@ -38,28 +38,6 @@*/ #define SYM_CONF_DMA_ADDRESSING_MODE CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE -/* -* NVRAM support. -*/ -#if 1 -#define SYM_CONF_NVRAM_SUPPORT (1) -#endif - -/* -* These options are not tunable from 'make config' -*/ -#if 1 -#define SYM_LINUX_PROC_INFO_SUPPORT -#define SYM_LINUX_USER_COMMAND_SUPPORT -#define SYM_LINUX_USER_INFO_SUPPORT -#define SYM_LINUX_DEBUG_CONTROL_SUPPORT -#endif - -/* -* Also handle old NCR chips if not (0). -*/ -#define SYM_CONF_GENERIC_SUPPORT (1) -/* * Allow tags from 2 to 256, default 8 */
@@ -191,12 +169,4 @@ extern unsigned int sym_debug_flags;#define SYM_CONF_IARB_MAX 3#define SYM_CONF_SET_IARB_ON_ARB_LOST 1 -/* -* Returning wrong residuals may make problems. -* When zero, this define tells the driver to -* always return 0 as transfer residual. -* Btw, all my testings of residuals have succeeded. -*/ -#define SYM_SETUP_RESIDUAL_SUPPORT 1 -#endif /* SYM53C8XX_H */
drivers/scsi/sym53c8xx_2/sym_fw.c +0 -10
@@ -36,7 +36,6 @@#define PADDR_B (label) SYM_GEN_PADDR_B(struct SYM_FWB_SCR, label) -#if SYM_CONF_GENERIC_SUPPORT /* * Allocate firmware #1 script area. */
@@ -56,7 +55,6 @@ static struct sym_fwz_ofs sym_fw1z_ofs = {#undef SYM_FWA_SCR#undef SYM_FWB_SCR#undef SYM_FWZ_SCR -#endif /* SYM_CONF_GENERIC_SUPPORT */ /* * Allocate firmware #2 script area.
@@ -86,7 +84,6 @@ static struct sym_fwz_ofs sym_fw2z_ofs = {#undef PADDR_A#undef PADDR_B -#if SYM_CONF_GENERIC_SUPPORT /* * Patch routine for firmware #1. */
@@ -127,7 +124,6 @@ sym_fw1_patch(struct Scsi_Host *shost) scriptb0->done_pos[0 ] =cpu_to_scr (np->dqueue_ba); scriptb0->targtbl[0 ] =cpu_to_scr (np->targtbl_ba); } -#endif /* SYM_CONF_GENERIC_SUPPORT */ /* * Patch routine for firmware #2.
@@ -274,7 +270,6 @@ sym_fw_setup_bus_addresses(struct sym_hcb *np, struct sym_fw *fw) pa[i] = np->scriptz_ba + po[i]; } -#if SYM_CONF_GENERIC_SUPPORT /* * Setup routine for firmware #1. */
@@ -295,7 +290,6 @@ sym_fw1_setup(struct sym_hcb *np, struct sym_fw *fw)*/ sym_fw_setup_bus_addresses (np, fw); } -#endif /* SYM_CONF_GENERIC_SUPPORT */ /* * Setup routine for firmware #2.
@@ -321,9 +315,7 @@ sym_fw2_setup(struct sym_hcb *np, struct sym_fw *fw)/* * Allocate firmware descriptors. */ -#if SYM_CONF_GENERIC_SUPPORT static struct sym_fw sym_fw1 =SYM_FW_ENTRY (sym_fw1,"NCR-generic" ); -#endif /* SYM_CONF_GENERIC_SUPPORT */ static struct sym_fw sym_fw2 =SYM_FW_ENTRY (sym_fw2,"LOAD/STORE-based" );/*
@@ -334,10 +326,8 @@ sym_find_firmware(struct sym_chip *chip) {if (chip->features &FE_LDSTR )return &sym_fw2; -#if SYM_CONF_GENERIC_SUPPORT else if (!(chip->features & (FE_PFEN |FE_NOPM |FE_DAC )))return &sym_fw1; -#endif else return NULL ; }
drivers/scsi/sym53c8xx_2/sym_glue.c +0 -40
@@ -908,7 +908,6 @@ static const char *sym53c8xx_info (struct Scsi_Host *host) } -#ifdef SYM_LINUX_PROC_INFO_SUPPORT /* * Proc file system stuff *
@@ -918,8 +917,6 @@ static const char *sym53c8xx_info (struct Scsi_Host *host)* to the sym_usercmd() function. */ -#ifdef SYM_LINUX_USER_COMMAND_SUPPORT -struct sym_usrcmd {u_long target;u_long lun;
@@ -944,11 +941,9 @@ static void sym_exec_user_command (struct sym_hcb *np, struct sym_usrcmd *uc)switch (uc->cmd) {case 0 :return ; -#ifdef SYM_LINUX_DEBUG_CONTROL_SUPPORT case UC_SETDEBUG : sym_debug_flags = uc->data;break ; -#endif case UC_SETVERBOSE : np->verbose = uc->data;break ;
@@ -1084,10 +1079,8 @@ static int sym_user_command(struct Scsi_Host *shost, char *buffer, int length) uc->cmd =UC_SETVERBOSE ; else if ((arg_len = is_keyword(ptr, len, "setwide")) != 0) uc->cmd = UC_SETWIDE; -#ifdef SYM_LINUX_DEBUG_CONTROL_SUPPORT else if ((arg_len = is_keyword(ptr, len, "setdebug")) != 0) uc->cmd = UC_SETDEBUG; -#endif else if ((arg_len = is_keyword(ptr, len, "setflag")) != 0) uc->cmd = UC_SETFLAG; else if ((arg_len = is_keyword(ptr, len, "resetdev")) != 0)
@@ -1097,10 +1090,6 @@ static int sym_user_command(struct Scsi_Host *shost, char *buffer, int length)else arg_len =0 ; -#ifdef DEBUG_PROC_INFO -printk ("sym_user_command: arg_len=%d, cmd=%ld\n" , arg_len, uc->cmd); -#endif -if (!arg_len)return -EINVAL ; ptr += arg_len; len -= arg_len;
@@ -1119,9 +1108,6 @@ printk("sym_user_command: arg_len=%d, cmd=%ld\n", arg_len, uc->cmd); }else {GET_INT_ARG (ptr, len, target); uc->target = (1 <<target); -#ifdef DEBUG_PROC_INFO -printk ("sym_user_command: target=%ld\n" , target); -#endif }break ; }
@@ -1133,11 +1119,7 @@ printk("sym_user_command: target=%ld\n", target);case UC_SETWIDE :SKIP_SPACES (ptr, len);GET_INT_ARG (ptr, len, uc->data); -#ifdef DEBUG_PROC_INFO -printk ("sym_user_command: data=%ld\n" , uc->data); -#endif break ; -#ifdef SYM_LINUX_DEBUG_CONTROL_SUPPORT case UC_SETDEBUG :while (len >0 ) {SKIP_SPACES (ptr, len);
@@ -1167,11 +1149,7 @@ printk("sym_user_command: data=%ld\n", uc->data);return -EINVAL ; ptr += arg_len; len -= arg_len; } -#ifdef DEBUG_PROC_INFO -printk ("sym_user_command: data=%ld\n" , uc->data); -#endif break ; -#endif /* SYM_LINUX_DEBUG_CONTROL_SUPPORT */ case UC_SETFLAG :while (len >0 ) {SKIP_SPACES (ptr, len);
@@ -1198,15 +1176,12 @@ printk("sym_user_command: data=%ld\n", uc->data);return length; } -#endif /* SYM_LINUX_USER_COMMAND_SUPPORT */ -/* * Copy formatted information into the input buffer. */ static int sym_show_info (struct seq_file *m,struct Scsi_Host *shost) { -#ifdef SYM_LINUX_USER_INFO_SUPPORT struct sym_data *sym_data =shost_priv (shost);struct pci_dev *pdev = sym_data->pdev;struct sym_hcb *np = sym_data->ncb;
@@ -1226,13 +1201,8 @@ static int sym_show_info(struct seq_file *m, struct Scsi_Host *shost) SYM_CONF_MAX_START, SYM_CONF_MAX_TAG);return 0 ; -#else -return -EINVAL ; -#endif /* SYM_LINUX_USER_INFO_SUPPORT */ } -#endif /* SYM_LINUX_PROC_INFO_SUPPORT */ -/* * Free resources claimed by sym_iomap_device(). Note that * sym_free_resources() should be used instead of this function after calling
@@ -1431,7 +1401,6 @@ static struct Scsi_Host *sym_attach(const struct scsi_host_template *tpnt, int u/* * Detect and try to read SYMBIOS and TEKRAM NVRAM. */ -#if SYM_CONF_NVRAM_SUPPORT static void sym_get_nvram (struct sym_device *devp,struct sym_nvram *nvp) { devp->nvram = nvp;
@@ -1439,11 +1408,6 @@ static void sym_get_nvram(struct sym_device *devp, struct sym_nvram *nvp)sym_read_nvram (devp, nvp); } -#else -static inline void sym_get_nvram (struct sym_device *devp,struct sym_nvram *nvp) -{ -} -#endif /* SYM_CONF_NVRAM_SUPPORT */ static int sym_check_supported (struct sym_device *device) {
@@ -1694,13 +1658,9 @@ static const struct scsi_host_template sym2_template = { .eh_host_reset_handler = sym53c8xx_eh_host_reset_handler, .this_id = 7, .max_sectors = 0xFFFF, -#ifdef SYM_LINUX_PROC_INFO_SUPPORT .show_info = sym_show_info, -#ifdef SYM_LINUX_USER_COMMAND_SUPPORT .write_info = sym_user_command, -#endif .proc_name = NAME53C8XX, -#endif };static int attach_count;
drivers/scsi/sym53c8xx_2/sym_hipd.c +2 -70
172 lines not on this page · raw message
drivers/scsi/sym53c8xx_2/sym_hipd.h +1 -15
@@ -293,12 +293,8 @@#define CCB_HASH_SHIFT 8#define CCB_HASH_SIZE (1UL << CCB_HASH_SHIFT)#define CCB_HASH_MASK (CCB_HASH_SIZE-1) -#if 1 #define CCB_HASH_CODE (dsa) \ (((dsa) >> (_LGRU16_(sizeof(struct sym_ccb)))) & CCB_HASH_MASK) -#else -#define CCB_HASH_CODE (dsa) (((dsa) >> 9) & CCB_HASH_MASK) -#endif #if SYM_CONF_DMA_ADDRESSING_MODE ==2 /*
@@ -660,7 +656,6 @@ struct sym_ccbh {* that use directly the header in the CCB, and the NCR-GENERIC * SCRIPTS that use the copy of the header in the HCB. */ -#if SYM_CONF_GENERIC_SUPPORT #define sym_set_script_dp (np, cp, dp) \ do { \ if (np->features & FE_LDSTR) \
@@ -671,14 +666,6 @@ struct sym_ccbh {#define sym_get_script_dp (np, cp) \ scr_to_cpu((np->features & FE_LDSTR) ? \ cp->phys.head.lastp : np->ccb_head.lastp) -#else -#define sym_set_script_dp (np, cp, dp) \ - do { \ - cp->phys.head.lastp = cpu_to_scr(dp); \ - } while (0) - -#define sym_get_script_dp (np, cp) (cp->phys.head.lastp) -#endif /* * Data Structure Block
@@ -801,11 +788,10 @@ struct sym_hcb {* chips (810, 815, 825) copy part of the data structures * (CCB, TCB and LCB) in fixed areas. */ -#if SYM_CONF_GENERIC_SUPPORT struct sym_ccbh ccb_head;struct sym_tcbh tcb_head;struct sym_lcbh lcb_head; -#endif +/* * Idle task and invalid task actions and * their bus addresses.
drivers/scsi/sym53c8xx_2/sym_nvram.h +0 -16
@@ -170,32 +170,16 @@ struct sym_nvram {#define SYM_SYMBIOS_NVRAM (1)#define SYM_TEKRAM_NVRAM (2)#define SYM_PARISC_PDC (3) -#if SYM_CONF_NVRAM_SUPPORT union {Symbios_nvram Symbios;Tekram_nvram Tekram;struct pdc_initiator parisc; } data; -#endif }; -#if SYM_CONF_NVRAM_SUPPORT void sym_nvram_setup_host (struct Scsi_Host *shost,struct sym_hcb *np,struct sym_nvram *nvram);void sym_nvram_setup_target (struct sym_tcb *tp,int target,struct sym_nvram *nvp);int sym_read_nvram (struct sym_device *np,struct sym_nvram *nvp);char *sym_nvram_type (struct sym_nvram *nvp); -#else -static inline void sym_nvram_setup_host (struct Scsi_Host *shost,struct sym_hcb *np,struct sym_nvram *nvram) { } -static inline void sym_nvram_setup_target (struct sym_tcb *tp,struct sym_nvram *nvram) { } -static inline int sym_read_nvram (struct sym_device *np,struct sym_nvram *nvp) -{ - nvp->type =0 ; -return 0 ; -} -static inline char *sym_nvram_type (struct sym_nvram *nvp) -{ -return "No NVRAM" ; -} -#endif #endif /* SYM_NVRAM_H */
Signature · 1 line
2.43.0
PATCH 2/2 scsi: sym53c8xx_2: remove empty sym_init_tcb function
In reply to Ethan Nelson-Moore--- drivers/scsi/sym53c8xx_2/sym_hipd.c | 13 ------------- 1 file changed, 13 deletions(-)
drivers/scsi/sym53c8xx_2/sym_hipd.c +0 -13
@@ -4906,14 +4906,6 @@ static struct sym_ccb *sym_ccb_from_dsa(struct sym_hcb *np, u32 dsa)return cp; } -/* -* Target control block initialisation. -* Nothing important to do at the moment. -*/ -static void sym_init_tcb (struct sym_hcb *np,u_char tn) -{ -} -/* * Lun control block allocation and initialization. */
@@ -4922,11 +4914,6 @@ struct sym_lcb *sym_alloc_lcb (struct sym_hcb *np, u_char tn, u_char ln)struct sym_tcb *tp = &np->target[tn];struct sym_lcb *lp =NULL ; -/* -* Initialize the target control block if not yet. -*/ -sym_init_tcb (np, tn); -/* * Allocate the LCB bus address array. * Compute the bus address of this table.
Signature · 1 line
2.43.0
PATCH v2 1/2 scsi: sym53c8xx_2: remove code depending on non-default values of macros
In reply to Ethan Nelson-MooreThe macros themselves are also removed.
This makes the code easier to understand and maintain. There is more unused code to remove, but this takes care of some low-hanging fruit. The changes were mostly done via unifdef.
--- drivers/scsi/sym53c8xx_2/sym53c8xx.h | 30 ------------ drivers/scsi/sym53c8xx_2/sym_fw.c | 10 ---- drivers/scsi/sym53c8xx_2/sym_glue.c | 40 ---------------- drivers/scsi/sym53c8xx_2/sym_hipd.c | 72 +--------------------------- drivers/scsi/sym53c8xx_2/sym_hipd.h | 16 +------ drivers/scsi/sym53c8xx_2/sym_nvram.h | 16 ------- 6 files changed, 3 insertions(+), 181 deletions(-)
drivers/scsi/sym53c8xx_2/sym53c8xx.h +0 -30
@@ -38,28 +38,6 @@*/ #define SYM_CONF_DMA_ADDRESSING_MODE CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE -/* -* NVRAM support. -*/ -#if 1 -#define SYM_CONF_NVRAM_SUPPORT (1) -#endif - -/* -* These options are not tunable from 'make config' -*/ -#if 1 -#define SYM_LINUX_PROC_INFO_SUPPORT -#define SYM_LINUX_USER_COMMAND_SUPPORT -#define SYM_LINUX_USER_INFO_SUPPORT -#define SYM_LINUX_DEBUG_CONTROL_SUPPORT -#endif - -/* -* Also handle old NCR chips if not (0). -*/ -#define SYM_CONF_GENERIC_SUPPORT (1) -/* * Allow tags from 2 to 256, default 8 */
@@ -191,12 +169,4 @@ extern unsigned int sym_debug_flags;#define SYM_CONF_IARB_MAX 3#define SYM_CONF_SET_IARB_ON_ARB_LOST 1 -/* -* Returning wrong residuals may make problems. -* When zero, this define tells the driver to -* always return 0 as transfer residual. -* Btw, all my testings of residuals have succeeded. -*/ -#define SYM_SETUP_RESIDUAL_SUPPORT 1 -#endif /* SYM53C8XX_H */
drivers/scsi/sym53c8xx_2/sym_fw.c +0 -10
@@ -36,7 +36,6 @@#define PADDR_B (label) SYM_GEN_PADDR_B(struct SYM_FWB_SCR, label) -#if SYM_CONF_GENERIC_SUPPORT /* * Allocate firmware #1 script area. */
@@ -56,7 +55,6 @@ static struct sym_fwz_ofs sym_fw1z_ofs = {#undef SYM_FWA_SCR#undef SYM_FWB_SCR#undef SYM_FWZ_SCR -#endif /* SYM_CONF_GENERIC_SUPPORT */ /* * Allocate firmware #2 script area.
@@ -86,7 +84,6 @@ static struct sym_fwz_ofs sym_fw2z_ofs = {#undef PADDR_A#undef PADDR_B -#if SYM_CONF_GENERIC_SUPPORT /* * Patch routine for firmware #1. */
@@ -127,7 +124,6 @@ sym_fw1_patch(struct Scsi_Host *shost) scriptb0->done_pos[0 ] =cpu_to_scr (np->dqueue_ba); scriptb0->targtbl[0 ] =cpu_to_scr (np->targtbl_ba); } -#endif /* SYM_CONF_GENERIC_SUPPORT */ /* * Patch routine for firmware #2.
@@ -274,7 +270,6 @@ sym_fw_setup_bus_addresses(struct sym_hcb *np, struct sym_fw *fw) pa[i] = np->scriptz_ba + po[i]; } -#if SYM_CONF_GENERIC_SUPPORT /* * Setup routine for firmware #1. */
@@ -295,7 +290,6 @@ sym_fw1_setup(struct sym_hcb *np, struct sym_fw *fw)*/ sym_fw_setup_bus_addresses (np, fw); } -#endif /* SYM_CONF_GENERIC_SUPPORT */ /* * Setup routine for firmware #2.
@@ -321,9 +315,7 @@ sym_fw2_setup(struct sym_hcb *np, struct sym_fw *fw)/* * Allocate firmware descriptors. */ -#if SYM_CONF_GENERIC_SUPPORT static struct sym_fw sym_fw1 =SYM_FW_ENTRY (sym_fw1,"NCR-generic" ); -#endif /* SYM_CONF_GENERIC_SUPPORT */ static struct sym_fw sym_fw2 =SYM_FW_ENTRY (sym_fw2,"LOAD/STORE-based" );/*
@@ -334,10 +326,8 @@ sym_find_firmware(struct sym_chip *chip) {if (chip->features &FE_LDSTR )return &sym_fw2; -#if SYM_CONF_GENERIC_SUPPORT else if (!(chip->features & (FE_PFEN |FE_NOPM |FE_DAC )))return &sym_fw1; -#endif else return NULL ; }
drivers/scsi/sym53c8xx_2/sym_glue.c +0 -40
@@ -908,7 +908,6 @@ static const char *sym53c8xx_info (struct Scsi_Host *host) } -#ifdef SYM_LINUX_PROC_INFO_SUPPORT /* * Proc file system stuff *
@@ -918,8 +917,6 @@ static const char *sym53c8xx_info (struct Scsi_Host *host)* to the sym_usercmd() function. */ -#ifdef SYM_LINUX_USER_COMMAND_SUPPORT -struct sym_usrcmd {u_long target;u_long lun;
@@ -944,11 +941,9 @@ static void sym_exec_user_command (struct sym_hcb *np, struct sym_usrcmd *uc)switch (uc->cmd) {case 0 :return ; -#ifdef SYM_LINUX_DEBUG_CONTROL_SUPPORT case UC_SETDEBUG : sym_debug_flags = uc->data;break ; -#endif case UC_SETVERBOSE : np->verbose = uc->data;break ;
@@ -1084,10 +1079,8 @@ static int sym_user_command(struct Scsi_Host *shost, char *buffer, int length) uc->cmd =UC_SETVERBOSE ; else if ((arg_len = is_keyword(ptr, len, "setwide")) != 0) uc->cmd = UC_SETWIDE; -#ifdef SYM_LINUX_DEBUG_CONTROL_SUPPORT else if ((arg_len = is_keyword(ptr, len, "setdebug")) != 0) uc->cmd = UC_SETDEBUG; -#endif else if ((arg_len = is_keyword(ptr, len, "setflag")) != 0) uc->cmd = UC_SETFLAG; else if ((arg_len = is_keyword(ptr, len, "resetdev")) != 0)
@@ -1097,10 +1090,6 @@ static int sym_user_command(struct Scsi_Host *shost, char *buffer, int length)else arg_len =0 ; -#ifdef DEBUG_PROC_INFO -printk ("sym_user_command: arg_len=%d, cmd=%ld\n" , arg_len, uc->cmd); -#endif -if (!arg_len)return -EINVAL ; ptr += arg_len; len -= arg_len;
@@ -1119,9 +1108,6 @@ printk("sym_user_command: arg_len=%d, cmd=%ld\n", arg_len, uc->cmd); }else {GET_INT_ARG (ptr, len, target); uc->target = (1 <<target); -#ifdef DEBUG_PROC_INFO -printk ("sym_user_command: target=%ld\n" , target); -#endif }break ; }
@@ -1133,11 +1119,7 @@ printk("sym_user_command: target=%ld\n", target);case UC_SETWIDE :SKIP_SPACES (ptr, len);GET_INT_ARG (ptr, len, uc->data); -#ifdef DEBUG_PROC_INFO -printk ("sym_user_command: data=%ld\n" , uc->data); -#endif break ; -#ifdef SYM_LINUX_DEBUG_CONTROL_SUPPORT case UC_SETDEBUG :while (len >0 ) {SKIP_SPACES (ptr, len);
@@ -1167,11 +1149,7 @@ printk("sym_user_command: data=%ld\n", uc->data);return -EINVAL ; ptr += arg_len; len -= arg_len; } -#ifdef DEBUG_PROC_INFO -printk ("sym_user_command: data=%ld\n" , uc->data); -#endif break ; -#endif /* SYM_LINUX_DEBUG_CONTROL_SUPPORT */ case UC_SETFLAG :while (len >0 ) {SKIP_SPACES (ptr, len);
@@ -1198,15 +1176,12 @@ printk("sym_user_command: data=%ld\n", uc->data);return length; } -#endif /* SYM_LINUX_USER_COMMAND_SUPPORT */ -/* * Copy formatted information into the input buffer. */ static int sym_show_info (struct seq_file *m,struct Scsi_Host *shost) { -#ifdef SYM_LINUX_USER_INFO_SUPPORT struct sym_data *sym_data =shost_priv (shost);struct pci_dev *pdev = sym_data->pdev;struct sym_hcb *np = sym_data->ncb;
@@ -1226,13 +1201,8 @@ static int sym_show_info(struct seq_file *m, struct Scsi_Host *shost) SYM_CONF_MAX_START, SYM_CONF_MAX_TAG);return 0 ; -#else -return -EINVAL ; -#endif /* SYM_LINUX_USER_INFO_SUPPORT */ } -#endif /* SYM_LINUX_PROC_INFO_SUPPORT */ -/* * Free resources claimed by sym_iomap_device(). Note that * sym_free_resources() should be used instead of this function after calling
@@ -1431,7 +1401,6 @@ static struct Scsi_Host *sym_attach(const struct scsi_host_template *tpnt, int u/* * Detect and try to read SYMBIOS and TEKRAM NVRAM. */ -#if SYM_CONF_NVRAM_SUPPORT static void sym_get_nvram (struct sym_device *devp,struct sym_nvram *nvp) { devp->nvram = nvp;
@@ -1439,11 +1408,6 @@ static void sym_get_nvram(struct sym_device *devp, struct sym_nvram *nvp)sym_read_nvram (devp, nvp); } -#else -static inline void sym_get_nvram (struct sym_device *devp,struct sym_nvram *nvp) -{ -} -#endif /* SYM_CONF_NVRAM_SUPPORT */ static int sym_check_supported (struct sym_device *device) {
@@ -1694,13 +1658,9 @@ static const struct scsi_host_template sym2_template = { .eh_host_reset_handler = sym53c8xx_eh_host_reset_handler, .this_id = 7, .max_sectors = 0xFFFF, -#ifdef SYM_LINUX_PROC_INFO_SUPPORT .show_info = sym_show_info, -#ifdef SYM_LINUX_USER_COMMAND_SUPPORT .write_info = sym_user_command, -#endif .proc_name = NAME53C8XX, -#endif };static int attach_count;
drivers/scsi/sym53c8xx_2/sym_hipd.c +2 -70
172 lines not on this page · raw message
drivers/scsi/sym53c8xx_2/sym_hipd.h +1 -15
@@ -293,12 +293,8 @@#define CCB_HASH_SHIFT 8#define CCB_HASH_SIZE (1UL << CCB_HASH_SHIFT)#define CCB_HASH_MASK (CCB_HASH_SIZE-1) -#if 1 #define CCB_HASH_CODE (dsa) \ (((dsa) >> (_LGRU16_(sizeof(struct sym_ccb)))) & CCB_HASH_MASK) -#else -#define CCB_HASH_CODE (dsa) (((dsa) >> 9) & CCB_HASH_MASK) -#endif #if SYM_CONF_DMA_ADDRESSING_MODE ==2 /*
@@ -660,7 +656,6 @@ struct sym_ccbh {* that use directly the header in the CCB, and the NCR-GENERIC * SCRIPTS that use the copy of the header in the HCB. */ -#if SYM_CONF_GENERIC_SUPPORT #define sym_set_script_dp (np, cp, dp) \ do { \ if (np->features & FE_LDSTR) \
@@ -671,14 +666,6 @@ struct sym_ccbh {#define sym_get_script_dp (np, cp) \ scr_to_cpu((np->features & FE_LDSTR) ? \ cp->phys.head.lastp : np->ccb_head.lastp) -#else -#define sym_set_script_dp (np, cp, dp) \ - do { \ - cp->phys.head.lastp = cpu_to_scr(dp); \ - } while (0) - -#define sym_get_script_dp (np, cp) (cp->phys.head.lastp) -#endif /* * Data Structure Block
@@ -801,11 +788,10 @@ struct sym_hcb {* chips (810, 815, 825) copy part of the data structures * (CCB, TCB and LCB) in fixed areas. */ -#if SYM_CONF_GENERIC_SUPPORT struct sym_ccbh ccb_head;struct sym_tcbh tcb_head;struct sym_lcbh lcb_head; -#endif +/* * Idle task and invalid task actions and * their bus addresses.
drivers/scsi/sym53c8xx_2/sym_nvram.h +0 -16
@@ -170,32 +170,16 @@ struct sym_nvram {#define SYM_SYMBIOS_NVRAM (1)#define SYM_TEKRAM_NVRAM (2)#define SYM_PARISC_PDC (3) -#if SYM_CONF_NVRAM_SUPPORT union {Symbios_nvram Symbios;Tekram_nvram Tekram;struct pdc_initiator parisc; } data; -#endif }; -#if SYM_CONF_NVRAM_SUPPORT void sym_nvram_setup_host (struct Scsi_Host *shost,struct sym_hcb *np,struct sym_nvram *nvram);void sym_nvram_setup_target (struct sym_tcb *tp,int target,struct sym_nvram *nvp);int sym_read_nvram (struct sym_device *np,struct sym_nvram *nvp);char *sym_nvram_type (struct sym_nvram *nvp); -#else -static inline void sym_nvram_setup_host (struct Scsi_Host *shost,struct sym_hcb *np,struct sym_nvram *nvram) { } -static inline void sym_nvram_setup_target (struct sym_tcb *tp,struct sym_nvram *nvram) { } -static inline int sym_read_nvram (struct sym_device *np,struct sym_nvram *nvp) -{ - nvp->type =0 ; -return 0 ; -} -static inline char *sym_nvram_type (struct sym_nvram *nvp) -{ -return "No NVRAM" ; -} -#endif #endif /* SYM_NVRAM_H */
Signature · 1 line
2.43.0
Re: [PATCH v2 1/2] scsi: sym53c8xx_2: remove code depending on non-default values of macros
Please disregard this message - I accidentally sent it to the wrong list. Apologies for the inconvenience.
PATCH v2 1/2 scsi: sym53c8xx_2: remove code depending on non-default values of macros
In reply to Ethan Nelson-MooreThe macros themselves are also removed.
This makes the code easier to understand and maintain. There is more unused code to remove, but this takes care of some low-hanging fruit. The changes were mostly done via unifdef.
--- drivers/scsi/sym53c8xx_2/sym53c8xx.h | 30 ------------ drivers/scsi/sym53c8xx_2/sym_fw.c | 10 ---- drivers/scsi/sym53c8xx_2/sym_glue.c | 40 ---------------- drivers/scsi/sym53c8xx_2/sym_hipd.c | 72 +--------------------------- drivers/scsi/sym53c8xx_2/sym_hipd.h | 16 +------ drivers/scsi/sym53c8xx_2/sym_nvram.h | 16 ------- 6 files changed, 3 insertions(+), 181 deletions(-)
drivers/scsi/sym53c8xx_2/sym53c8xx.h +0 -30
@@ -38,28 +38,6 @@*/ #define SYM_CONF_DMA_ADDRESSING_MODE CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE -/* -* NVRAM support. -*/ -#if 1 -#define SYM_CONF_NVRAM_SUPPORT (1) -#endif - -/* -* These options are not tunable from 'make config' -*/ -#if 1 -#define SYM_LINUX_PROC_INFO_SUPPORT -#define SYM_LINUX_USER_COMMAND_SUPPORT -#define SYM_LINUX_USER_INFO_SUPPORT -#define SYM_LINUX_DEBUG_CONTROL_SUPPORT -#endif - -/* -* Also handle old NCR chips if not (0). -*/ -#define SYM_CONF_GENERIC_SUPPORT (1) -/* * Allow tags from 2 to 256, default 8 */
@@ -191,12 +169,4 @@ extern unsigned int sym_debug_flags;#define SYM_CONF_IARB_MAX 3#define SYM_CONF_SET_IARB_ON_ARB_LOST 1 -/* -* Returning wrong residuals may make problems. -* When zero, this define tells the driver to -* always return 0 as transfer residual. -* Btw, all my testings of residuals have succeeded. -*/ -#define SYM_SETUP_RESIDUAL_SUPPORT 1 -#endif /* SYM53C8XX_H */
drivers/scsi/sym53c8xx_2/sym_fw.c +0 -10
@@ -36,7 +36,6 @@#define PADDR_B (label) SYM_GEN_PADDR_B(struct SYM_FWB_SCR, label) -#if SYM_CONF_GENERIC_SUPPORT /* * Allocate firmware #1 script area. */
@@ -56,7 +55,6 @@ static struct sym_fwz_ofs sym_fw1z_ofs = {#undef SYM_FWA_SCR#undef SYM_FWB_SCR#undef SYM_FWZ_SCR -#endif /* SYM_CONF_GENERIC_SUPPORT */ /* * Allocate firmware #2 script area.
@@ -86,7 +84,6 @@ static struct sym_fwz_ofs sym_fw2z_ofs = {#undef PADDR_A#undef PADDR_B -#if SYM_CONF_GENERIC_SUPPORT /* * Patch routine for firmware #1. */
@@ -127,7 +124,6 @@ sym_fw1_patch(struct Scsi_Host *shost) scriptb0->done_pos[0 ] =cpu_to_scr (np->dqueue_ba); scriptb0->targtbl[0 ] =cpu_to_scr (np->targtbl_ba); } -#endif /* SYM_CONF_GENERIC_SUPPORT */ /* * Patch routine for firmware #2.
@@ -274,7 +270,6 @@ sym_fw_setup_bus_addresses(struct sym_hcb *np, struct sym_fw *fw) pa[i] = np->scriptz_ba + po[i]; } -#if SYM_CONF_GENERIC_SUPPORT /* * Setup routine for firmware #1. */
@@ -295,7 +290,6 @@ sym_fw1_setup(struct sym_hcb *np, struct sym_fw *fw)*/ sym_fw_setup_bus_addresses (np, fw); } -#endif /* SYM_CONF_GENERIC_SUPPORT */ /* * Setup routine for firmware #2.
@@ -321,9 +315,7 @@ sym_fw2_setup(struct sym_hcb *np, struct sym_fw *fw)/* * Allocate firmware descriptors. */ -#if SYM_CONF_GENERIC_SUPPORT static struct sym_fw sym_fw1 =SYM_FW_ENTRY (sym_fw1,"NCR-generic" ); -#endif /* SYM_CONF_GENERIC_SUPPORT */ static struct sym_fw sym_fw2 =SYM_FW_ENTRY (sym_fw2,"LOAD/STORE-based" );/*
@@ -334,10 +326,8 @@ sym_find_firmware(struct sym_chip *chip) {if (chip->features &FE_LDSTR )return &sym_fw2; -#if SYM_CONF_GENERIC_SUPPORT else if (!(chip->features & (FE_PFEN |FE_NOPM |FE_DAC )))return &sym_fw1; -#endif else return NULL ; }
drivers/scsi/sym53c8xx_2/sym_glue.c +0 -40
@@ -908,7 +908,6 @@ static const char *sym53c8xx_info (struct Scsi_Host *host) } -#ifdef SYM_LINUX_PROC_INFO_SUPPORT /* * Proc file system stuff *
@@ -918,8 +917,6 @@ static const char *sym53c8xx_info (struct Scsi_Host *host)* to the sym_usercmd() function. */ -#ifdef SYM_LINUX_USER_COMMAND_SUPPORT -struct sym_usrcmd {u_long target;u_long lun;
@@ -944,11 +941,9 @@ static void sym_exec_user_command (struct sym_hcb *np, struct sym_usrcmd *uc)switch (uc->cmd) {case 0 :return ; -#ifdef SYM_LINUX_DEBUG_CONTROL_SUPPORT case UC_SETDEBUG : sym_debug_flags = uc->data;break ; -#endif case UC_SETVERBOSE : np->verbose = uc->data;break ;
@@ -1084,10 +1079,8 @@ static int sym_user_command(struct Scsi_Host *shost, char *buffer, int length) uc->cmd =UC_SETVERBOSE ; else if ((arg_len = is_keyword(ptr, len, "setwide")) != 0) uc->cmd = UC_SETWIDE; -#ifdef SYM_LINUX_DEBUG_CONTROL_SUPPORT else if ((arg_len = is_keyword(ptr, len, "setdebug")) != 0) uc->cmd = UC_SETDEBUG; -#endif else if ((arg_len = is_keyword(ptr, len, "setflag")) != 0) uc->cmd = UC_SETFLAG; else if ((arg_len = is_keyword(ptr, len, "resetdev")) != 0)
@@ -1097,10 +1090,6 @@ static int sym_user_command(struct Scsi_Host *shost, char *buffer, int length)else arg_len =0 ; -#ifdef DEBUG_PROC_INFO -printk ("sym_user_command: arg_len=%d, cmd=%ld\n" , arg_len, uc->cmd); -#endif -if (!arg_len)return -EINVAL ; ptr += arg_len; len -= arg_len;
@@ -1119,9 +1108,6 @@ printk("sym_user_command: arg_len=%d, cmd=%ld\n", arg_len, uc->cmd); }else {GET_INT_ARG (ptr, len, target); uc->target = (1 <<target); -#ifdef DEBUG_PROC_INFO -printk ("sym_user_command: target=%ld\n" , target); -#endif }break ; }
@@ -1133,11 +1119,7 @@ printk("sym_user_command: target=%ld\n", target);case UC_SETWIDE :SKIP_SPACES (ptr, len);GET_INT_ARG (ptr, len, uc->data); -#ifdef DEBUG_PROC_INFO -printk ("sym_user_command: data=%ld\n" , uc->data); -#endif break ; -#ifdef SYM_LINUX_DEBUG_CONTROL_SUPPORT case UC_SETDEBUG :while (len >0 ) {SKIP_SPACES (ptr, len);
@@ -1167,11 +1149,7 @@ printk("sym_user_command: data=%ld\n", uc->data);return -EINVAL ; ptr += arg_len; len -= arg_len; } -#ifdef DEBUG_PROC_INFO -printk ("sym_user_command: data=%ld\n" , uc->data); -#endif break ; -#endif /* SYM_LINUX_DEBUG_CONTROL_SUPPORT */ case UC_SETFLAG :while (len >0 ) {SKIP_SPACES (ptr, len);
@@ -1198,15 +1176,12 @@ printk("sym_user_command: data=%ld\n", uc->data);return length; } -#endif /* SYM_LINUX_USER_COMMAND_SUPPORT */ -/* * Copy formatted information into the input buffer. */ static int sym_show_info (struct seq_file *m,struct Scsi_Host *shost) { -#ifdef SYM_LINUX_USER_INFO_SUPPORT struct sym_data *sym_data =shost_priv (shost);struct pci_dev *pdev = sym_data->pdev;struct sym_hcb *np = sym_data->ncb;
@@ -1226,13 +1201,8 @@ static int sym_show_info(struct seq_file *m, struct Scsi_Host *shost) SYM_CONF_MAX_START, SYM_CONF_MAX_TAG);return 0 ; -#else -return -EINVAL ; -#endif /* SYM_LINUX_USER_INFO_SUPPORT */ } -#endif /* SYM_LINUX_PROC_INFO_SUPPORT */ -/* * Free resources claimed by sym_iomap_device(). Note that * sym_free_resources() should be used instead of this function after calling
@@ -1431,7 +1401,6 @@ static struct Scsi_Host *sym_attach(const struct scsi_host_template *tpnt, int u/* * Detect and try to read SYMBIOS and TEKRAM NVRAM. */ -#if SYM_CONF_NVRAM_SUPPORT static void sym_get_nvram (struct sym_device *devp,struct sym_nvram *nvp) { devp->nvram = nvp;
@@ -1439,11 +1408,6 @@ static void sym_get_nvram(struct sym_device *devp, struct sym_nvram *nvp)sym_read_nvram (devp, nvp); } -#else -static inline void sym_get_nvram (struct sym_device *devp,struct sym_nvram *nvp) -{ -} -#endif /* SYM_CONF_NVRAM_SUPPORT */ static int sym_check_supported (struct sym_device *device) {
@@ -1694,13 +1658,9 @@ static const struct scsi_host_template sym2_template = { .eh_host_reset_handler = sym53c8xx_eh_host_reset_handler, .this_id = 7, .max_sectors = 0xFFFF, -#ifdef SYM_LINUX_PROC_INFO_SUPPORT .show_info = sym_show_info, -#ifdef SYM_LINUX_USER_COMMAND_SUPPORT .write_info = sym_user_command, -#endif .proc_name = NAME53C8XX, -#endif };static int attach_count;
drivers/scsi/sym53c8xx_2/sym_hipd.c +2 -70
172 lines not on this page · raw message
drivers/scsi/sym53c8xx_2/sym_hipd.h +1 -15
@@ -293,12 +293,8 @@#define CCB_HASH_SHIFT 8#define CCB_HASH_SIZE (1UL << CCB_HASH_SHIFT)#define CCB_HASH_MASK (CCB_HASH_SIZE-1) -#if 1 #define CCB_HASH_CODE (dsa) \ (((dsa) >> (_LGRU16_(sizeof(struct sym_ccb)))) & CCB_HASH_MASK) -#else -#define CCB_HASH_CODE (dsa) (((dsa) >> 9) & CCB_HASH_MASK) -#endif #if SYM_CONF_DMA_ADDRESSING_MODE ==2 /*
@@ -660,7 +656,6 @@ struct sym_ccbh {* that use directly the header in the CCB, and the NCR-GENERIC * SCRIPTS that use the copy of the header in the HCB. */ -#if SYM_CONF_GENERIC_SUPPORT #define sym_set_script_dp (np, cp, dp) \ do { \ if (np->features & FE_LDSTR) \
@@ -671,14 +666,6 @@ struct sym_ccbh {#define sym_get_script_dp (np, cp) \ scr_to_cpu((np->features & FE_LDSTR) ? \ cp->phys.head.lastp : np->ccb_head.lastp) -#else -#define sym_set_script_dp (np, cp, dp) \ - do { \ - cp->phys.head.lastp = cpu_to_scr(dp); \ - } while (0) - -#define sym_get_script_dp (np, cp) (cp->phys.head.lastp) -#endif /* * Data Structure Block
@@ -801,11 +788,10 @@ struct sym_hcb {* chips (810, 815, 825) copy part of the data structures * (CCB, TCB and LCB) in fixed areas. */ -#if SYM_CONF_GENERIC_SUPPORT struct sym_ccbh ccb_head;struct sym_tcbh tcb_head;struct sym_lcbh lcb_head; -#endif +/* * Idle task and invalid task actions and * their bus addresses.
drivers/scsi/sym53c8xx_2/sym_nvram.h +0 -16
@@ -170,32 +170,16 @@ struct sym_nvram {#define SYM_SYMBIOS_NVRAM (1)#define SYM_TEKRAM_NVRAM (2)#define SYM_PARISC_PDC (3) -#if SYM_CONF_NVRAM_SUPPORT union {Symbios_nvram Symbios;Tekram_nvram Tekram;struct pdc_initiator parisc; } data; -#endif }; -#if SYM_CONF_NVRAM_SUPPORT void sym_nvram_setup_host (struct Scsi_Host *shost,struct sym_hcb *np,struct sym_nvram *nvram);void sym_nvram_setup_target (struct sym_tcb *tp,int target,struct sym_nvram *nvp);int sym_read_nvram (struct sym_device *np,struct sym_nvram *nvp);char *sym_nvram_type (struct sym_nvram *nvp); -#else -static inline void sym_nvram_setup_host (struct Scsi_Host *shost,struct sym_hcb *np,struct sym_nvram *nvram) { } -static inline void sym_nvram_setup_target (struct sym_tcb *tp,struct sym_nvram *nvram) { } -static inline int sym_read_nvram (struct sym_device *np,struct sym_nvram *nvp) -{ - nvp->type =0 ; -return 0 ; -} -static inline char *sym_nvram_type (struct sym_nvram *nvp) -{ -return "No NVRAM" ; -} -#endif #endif /* SYM_NVRAM_H */
Signature · 1 line
2.43.0
PATCH v2 2/2 scsi: sym53c8xx_2: remove empty sym_init_tcb function
--- drivers/scsi/sym53c8xx_2/sym_hipd.c | 13 ------------- 1 file changed, 13 deletions(-)
drivers/scsi/sym53c8xx_2/sym_hipd.c +0 -13
@@ -4906,14 +4906,6 @@ static struct sym_ccb *sym_ccb_from_dsa(struct sym_hcb *np, u32 dsa)return cp; } -/* -* Target control block initialisation. -* Nothing important to do at the moment. -*/ -static void sym_init_tcb (struct sym_hcb *np,u_char tn) -{ -} -/* * Lun control block allocation and initialization. */
@@ -4922,11 +4914,6 @@ struct sym_lcb *sym_alloc_lcb (struct sym_hcb *np, u_char tn, u_char ln)struct sym_tcb *tp = &np->target[tn];struct sym_lcb *lp =NULL ; -/* -* Initialize the target control block if not yet. -*/ -sym_init_tcb (np, tn); -/* * Allocate the LCB bus address array. * Compute the bus address of this table.
Signature · 1 line
2.43.0
PATCH v2 1/1 scsi: remove several unused functions
In reply to Ethan Nelson-Moore--- drivers/scsi/aic7xxx/aic79xx_core.c | 89 --------------------------- drivers/scsi/aic7xxx/aic79xx_inline.h | 10 --- drivers/scsi/aic7xxx/aic79xx_osm.c | 16 ----- drivers/scsi/aic7xxx/aic7xxx_core.c | 35 ----------- drivers/scsi/nsp32.c | 19 ------ drivers/scsi/ses.c | 24 -------- 6 files changed, 193 deletions(-)
drivers/scsi/aic7xxx/aic79xx_core.c +0 -89
@@ -659,28 +659,12 @@ ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr)ahd_outb (ahd,SCBPTR +1 , (scbptr >>8 ) &0xFF ); } -#if 0 /* unused */ -static u_int -ahd_get_hnscb_qoff (struct ahd_softc *ahd) -{ -return (ahd_inw_atomic (ahd,HNSCB_QOFF )); -} -#endif -static void ahd_set_hnscb_qoff (struct ahd_softc *ahd,u_int value) {ahd_outw_atomic (ahd,HNSCB_QOFF , value); } -#if 0 /* unused */ -static u_int -ahd_get_hescb_qoff (struct ahd_softc *ahd) -{ -return (ahd_inb (ahd,HESCB_QOFF )); -} -#endif -static void ahd_set_hescb_qoff (struct ahd_softc *ahd,u_int value) {
@@ -705,15 +689,6 @@ ahd_set_snscb_qoff(struct ahd_softc *ahd, u_int value)ahd_outw (ahd,SNSCB_QOFF , value); } -#if 0 /* unused */ -static u_int -ahd_get_sescb_qoff (struct ahd_softc *ahd) -{ -AHD_ASSERT_MODES (ahd,AHD_MODE_CCHAN_MSK ,AHD_MODE_CCHAN_MSK ); -return (ahd_inb (ahd,SESCB_QOFF )); -} -#endif -static void ahd_set_sescb_qoff (struct ahd_softc *ahd,u_int value) {
@@ -721,15 +696,6 @@ ahd_set_sescb_qoff(struct ahd_softc *ahd, u_int value)ahd_outb (ahd,SESCB_QOFF , value); } -#if 0 /* unused */ -static u_int -ahd_get_sdscb_qoff (struct ahd_softc *ahd) -{ -AHD_ASSERT_MODES (ahd,AHD_MODE_CCHAN_MSK ,AHD_MODE_CCHAN_MSK ); -return (ahd_inb (ahd,SDSCB_QOFF ) | (ahd_inb (ahd,SDSCB_QOFF +1 ) <<8 )); -} -#endif -static void ahd_set_sdscb_qoff (struct ahd_softc *ahd,u_int value) {
@@ -3560,33 +3526,6 @@ ahd_clear_intstat(struct ahd_softc *ahd)uint32_t ahd_debug =AHD_DEBUG_OPTS ;#endif -#if 0 -void -ahd_print_scb (struct scb *scb) -{ -struct hardware_scb *hscb; -int i; - - hscb = scb->hscb; -printk ("scb:%p control:0x%x scsiid:0x%x lun:%d cdb_len:%d\n" , - (void *)scb, - hscb->control, - hscb->scsiid, - hscb->lun, - hscb->cdb_len); -printk ("Shared Data: " ); -for (i =0 ; i <sizeof (hscb->shared_data.idata.cdb); i++) -printk ("%#02x" , hscb->shared_data.idata.cdb[i]); -printk (" dataptr:%#x%x datacnt:%#x sgptr:%#x tag:%#x\n" , - (uint32_t )((ahd_le64toh (hscb->dataptr) >>32 ) &0xFFFFFFFF ), - (uint32_t )(ahd_le64toh (hscb->dataptr) &0xFFFFFFFF ), -ahd_le32toh (hscb->datacnt), -ahd_le32toh (hscb->sgptr), -SCB_GET_TAG (scb)); -ahd_dump_sglist (scb); -} -#endif /* 0 */ -/************************* Transfer Negotiation *******************************/ /* * Allocate per target mode instance (ID we respond to as a target)
@@ -9889,34 +9828,6 @@ ahd_dump_card_state(struct ahd_softc *ahd)ahd_unpause (ahd); } -#if 0 -void -ahd_dump_scbs (struct ahd_softc *ahd) -{ -ahd_mode_state saved_modes; -u_int saved_scb_index; -int i; - - saved_modes =ahd_save_modes (ahd); -ahd_set_modes (ahd,AHD_MODE_SCSI ,AHD_MODE_SCSI ); - saved_scb_index =ahd_get_scbptr (ahd); -for (i =0 ; i <AHD_SCB_MAX ; i++) { -ahd_set_scbptr (ahd, i); -printk ("%3d" , i); -printk ("(CTRL 0x%x ID 0x%x N 0x%x N2 0x%x SG 0x%x, RSG 0x%x)\n" , -ahd_inb_scbram (ahd,SCB_CONTROL ), -ahd_inb_scbram (ahd,SCB_SCSIID ), -ahd_inw_scbram (ahd,SCB_NEXT ), -ahd_inw_scbram (ahd,SCB_NEXT2 ), -ahd_inl_scbram (ahd,SCB_SGPTR ), -ahd_inl_scbram (ahd,SCB_RESIDUAL_SGPTR )); - } -printk ("\n" ); -ahd_set_scbptr (ahd, saved_scb_index); -ahd_restore_modes (ahd, saved_modes); -} -#endif /* 0 */ -/**************************** Flexport Logic **********************************/ /* * Read count 16bit words from 16bit word address start_addr from the
drivers/scsi/aic7xxx/aic79xx_inline.h +0 -10
@@ -144,16 +144,6 @@ static inline uint8_t *ahd_get_sense_buf(struct ahd_softc *ahd,static inline uint32_t ahd_get_sense_bufaddr (struct ahd_softc *ahd,struct scb *scb); -#if 0 /* unused */ - -#define AHD_COPY_COL_IDX (dst, src) \ -do { \ - dst->hscb->scsiid = src->hscb->scsiid; \ - dst->hscb->lun = src->hscb->lun; \ -} while (0) - -#endif -static inline uint8_t *ahd_get_sense_buf (struct ahd_softc *ahd,struct scb *scb) {
drivers/scsi/aic7xxx/aic79xx_osm.c +0 -16
@@ -411,22 +411,6 @@ ahd_inb(struct ahd_softc * ahd, long port)return (x); } -#if 0 /* unused */ -static uint16_t -ahd_inw_atomic (struct ahd_softc * ahd,long port) -{ -uint8_t x; - -if (ahd->tags[0 ] ==BUS_SPACE_MEMIO ) { - x =readw (ahd->bshs[0 ].maddr + port); - }else { - x =inw (ahd->bshs[(port) >>8 ].ioport + ((port) &0xFF )); - } -mb (); -return (x); -} -#endif -void ahd_outb (struct ahd_softc * ahd,long port,uint8_t val) {
drivers/scsi/aic7xxx/aic7xxx_core.c +0 -35
@@ -2072,41 +2072,6 @@ ahc_clear_intstat(struct ahc_softc *ahc)uint32_t ahc_debug =AHC_DEBUG_OPTS ;#endif -#if 0 /* unused */ -static void -ahc_print_scb (struct scb *scb) -{ -int i; - -struct hardware_scb *hscb = scb->hscb; - -printk ("scb:%p control:0x%x scsiid:0x%x lun:%d cdb_len:%d\n" , - (void *)scb, - hscb->control, - hscb->scsiid, - hscb->lun, - hscb->cdb_len); -printk ("Shared Data: " ); -for (i =0 ; i <sizeof (hscb->shared_data.cdb); i++) -printk ("%#02x" , hscb->shared_data.cdb[i]); -printk (" dataptr:%#x datacnt:%#x sgptr:%#x tag:%#x\n" , -ahc_le32toh (hscb->dataptr), -ahc_le32toh (hscb->datacnt), -ahc_le32toh (hscb->sgptr), - hscb->tag); -if (scb->sg_count >0 ) { -for (i =0 ; i < scb->sg_count; i++) { -printk ("sg[%d] - Addr 0x%x%x : Length %d\n" , - i, - (ahc_le32toh (scb->sg_list[i].len) >>24 - &SG_HIGH_ADDR_BITS ), -ahc_le32toh (scb->sg_list[i].addr), -ahc_le32toh (scb->sg_list[i].len)); - } - } -} -#endif -/************************* Transfer Negotiation *******************************/ /* * Allocate per target mode instance (ID we respond to as a target)
drivers/scsi/nsp32.c +0 -19
@@ -424,25 +424,6 @@ static void nsp32_build_reject(struct scsi_cmnd *SCpnt) data->msgout_len = pos; } -/* -* timer -*/ -#if 0 -static void nsp32_start_timer (struct scsi_cmnd *SCpnt,int time) -{ -unsigned int base = SCpnt->host->io_port; - -nsp32_dbg (NSP32_DEBUG_INTR ,"timer=%d" , time); - -if (time & (~TIMER_CNT_MASK )) { -nsp32_dbg (NSP32_DEBUG_INTR ,"timer set overflow" ); - } - -nsp32_write2 (base,TIMER_SET , time &TIMER_CNT_MASK ); -} -#endif - -/* * set SCSI command and other parameter to asic, and start selection phase */
drivers/scsi/ses.c +0 -24
@@ -441,30 +441,6 @@ static struct enclosure_component_callbacks ses_enclosure_callbacks = { .show_id = ses_show_id, }; -struct ses_host_edev { -struct Scsi_Host *shost; -struct enclosure_device *edev; -}; - -#if 0 -int ses_match_host (struct enclosure_device *edev,void *data) -{ -struct ses_host_edev *sed = data; -struct scsi_device *sdev; - -if (!scsi_is_sdev_device (edev->edev.parent)) -return 0 ; - - sdev =to_scsi_device (edev->edev.parent); - -if (sdev->host != sed->shost) -return 0 ; - - sed->edev = edev; -return 1 ; -} -#endif /* 0 */ -static int ses_process_descriptor (struct enclosure_component *ecomp,unsigned char *desc,int max_desc_len) {
Signature · 1 line
2.43.0