Commit 522f247d authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] more NULL noise removal in drivers/scsi

trivial junk that had been hanging arond in my tree for months now...
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f5f11ecb
...@@ -551,7 +551,7 @@ int tw_aen_read_queue(TW_Device_Extension *tw_dev, int request_id) ...@@ -551,7 +551,7 @@ int tw_aen_read_queue(TW_Device_Extension *tw_dev, int request_id)
/* Now post the command packet */ /* Now post the command packet */
if ((status_reg_value & TW_STATUS_COMMAND_QUEUE_FULL) == 0) { if ((status_reg_value & TW_STATUS_COMMAND_QUEUE_FULL) == 0) {
dprintk(KERN_WARNING "3w-xxxx: tw_aen_read_queue(): Post succeeded.\n"); dprintk(KERN_WARNING "3w-xxxx: tw_aen_read_queue(): Post succeeded.\n");
tw_dev->srb[request_id] = 0; /* Flag internal command */ tw_dev->srb[request_id] = NULL; /* Flag internal command */
tw_dev->state[request_id] = TW_S_POSTED; tw_dev->state[request_id] = TW_S_POSTED;
outl(command_que_value, command_que_addr); outl(command_que_value, command_que_addr);
} else { } else {
...@@ -718,7 +718,7 @@ static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int ...@@ -718,7 +718,7 @@ static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
tw_state_request_start(tw_dev, &request_id); tw_state_request_start(tw_dev, &request_id);
/* Flag internal command */ /* Flag internal command */
tw_dev->srb[request_id] = 0; tw_dev->srb[request_id] = NULL;
/* Flag chrdev ioctl */ /* Flag chrdev ioctl */
tw_dev->chrdev_request_id = request_id; tw_dev->chrdev_request_id = request_id;
...@@ -2692,7 +2692,7 @@ int tw_scsi_release(struct Scsi_Host *tw_host) ...@@ -2692,7 +2692,7 @@ int tw_scsi_release(struct Scsi_Host *tw_host)
/* Fake like we just shut down, so notify the card that /* Fake like we just shut down, so notify the card that
* we "shut down cleanly". * we "shut down cleanly".
*/ */
tw_halt(0, 0, 0); // parameters aren't actually used tw_halt(NULL, 0, NULL); // parameters aren't actually used
/* Free up the IO region */ /* Free up the IO region */
release_region((tw_dev->tw_pci_dev->resource[0].start), TW_IO_ADDRESS_RANGE); release_region((tw_dev->tw_pci_dev->resource[0].start), TW_IO_ADDRESS_RANGE);
......
...@@ -94,7 +94,7 @@ enum { ...@@ -94,7 +94,7 @@ enum {
}; };
/* The master ring of all esp hosts we are managing in this driver. */ /* The master ring of all esp hosts we are managing in this driver. */
struct NCR_ESP *espchain = 0; struct NCR_ESP *espchain;
int nesps = 0, esps_in_use = 0, esps_running = 0; int nesps = 0, esps_in_use = 0, esps_running = 0;
irqreturn_t esp_intr(int irq, void *dev_id, struct pt_regs *pregs); irqreturn_t esp_intr(int irq, void *dev_id, struct pt_regs *pregs);
...@@ -555,7 +555,7 @@ struct NCR_ESP* esp_allocate(Scsi_Host_Template *tpnt, void *esp_dev) ...@@ -555,7 +555,7 @@ struct NCR_ESP* esp_allocate(Scsi_Host_Template *tpnt, void *esp_dev)
} else { } else {
espchain = esp; espchain = esp;
} }
esp->next = 0; esp->next = NULL;
return esp; return esp;
} }
...@@ -565,7 +565,7 @@ void esp_deallocate(struct NCR_ESP *esp) ...@@ -565,7 +565,7 @@ void esp_deallocate(struct NCR_ESP *esp)
struct NCR_ESP *elink; struct NCR_ESP *elink;
if(espchain == esp) { if(espchain == esp) {
espchain = 0; espchain = NULL;
} else { } else {
for(elink = espchain; elink && (elink->next != esp); elink = elink->next); for(elink = espchain; elink && (elink->next != esp); elink = elink->next);
if(elink) if(elink)
...@@ -708,9 +708,9 @@ void esp_initialize(struct NCR_ESP *esp) ...@@ -708,9 +708,9 @@ void esp_initialize(struct NCR_ESP *esp)
} }
/* Initialize the command queues */ /* Initialize the command queues */
esp->current_SC = 0; esp->current_SC = NULL;
esp->disconnected_SC = 0; esp->disconnected_SC = NULL;
esp->issue_SC = 0; esp->issue_SC = NULL;
/* Clear the state machines. */ /* Clear the state machines. */
esp->targets_present = 0; esp->targets_present = 0;
...@@ -1728,7 +1728,7 @@ static inline void esp_reconnect(struct NCR_ESP *esp, Scsi_Cmnd *sp) ...@@ -1728,7 +1728,7 @@ static inline void esp_reconnect(struct NCR_ESP *esp, Scsi_Cmnd *sp)
ESPLOG(("esp%d: Weird, being reselected but disconnected " ESPLOG(("esp%d: Weird, being reselected but disconnected "
"command queue is empty.\n", esp->esp_id)); "command queue is empty.\n", esp->esp_id));
esp->snip = 0; esp->snip = 0;
esp->current_SC = 0; esp->current_SC = NULL;
sp->SCp.phase = not_issued; sp->SCp.phase = not_issued;
append_SC(&esp->issue_SC, sp); append_SC(&esp->issue_SC, sp);
} }
...@@ -3393,7 +3393,7 @@ static int esp_work_bus(struct NCR_ESP *esp, struct ESP_regs *eregs) ...@@ -3393,7 +3393,7 @@ static int esp_work_bus(struct NCR_ESP *esp, struct ESP_regs *eregs)
} }
static espfunc_t isvc_vector[] = { static espfunc_t isvc_vector[] = {
0, NULL,
esp_do_phase_determine, esp_do_phase_determine,
esp_do_resetbus, esp_do_resetbus,
esp_finish_reset, esp_finish_reset,
......
...@@ -363,7 +363,7 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id, ...@@ -363,7 +363,7 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id,
/* /*
* Clear it off the queue * Clear it off the queue
*/ */
dev->id[target_id].curr_req = 0; dev->id[target_id].curr_req = NULL;
dev->working--; dev->working--;
spin_unlock_irqrestore(dev->host->host_lock, flags); spin_unlock_irqrestore(dev->host->host_lock, flags);
/* /*
...@@ -2263,10 +2263,10 @@ static int atp870u_init_tables(struct Scsi_Host *host) ...@@ -2263,10 +2263,10 @@ static int atp870u_init_tables(struct Scsi_Host *host)
dev->in_snd = 0; dev->in_snd = 0;
dev->in_int = 0; dev->in_int = 0;
for (k = 0; k < qcnt; k++) { for (k = 0; k < qcnt; k++) {
dev->querequ[k] = 0; dev->querequ[k] = NULL;
} }
for (k = 0; k < 16; k++) { for (k = 0; k < 16; k++) {
dev->id[k].curr_req = 0; dev->id[k].curr_req = NULL;
dev->sp[k] = 0x04; dev->sp[k] = 0x04;
} }
return 0; return 0;
......
...@@ -989,7 +989,7 @@ static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb, ...@@ -989,7 +989,7 @@ static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb,
srb->sg_count = 0; srb->sg_count = 0;
srb->total_xfer_length = 0; srb->total_xfer_length = 0;
srb->sg_bus_addr = 0; srb->sg_bus_addr = 0;
srb->virt_addr = 0; srb->virt_addr = NULL;
srb->sg_index = 0; srb->sg_index = 0;
srb->adapter_status = 0; srb->adapter_status = 0;
srb->target_status = 0; srb->target_status = 0;
...@@ -2016,7 +2016,7 @@ static void sg_update_list(struct ScsiReqBlk *srb, u32 left) ...@@ -2016,7 +2016,7 @@ static void sg_update_list(struct ScsiReqBlk *srb, u32 left)
} }
dprintkl(KERN_ERR, "sg_update_list: sg_to_virt failed\n"); dprintkl(KERN_ERR, "sg_update_list: sg_to_virt failed\n");
srb->virt_addr = 0; srb->virt_addr = NULL;
} }
...@@ -3656,7 +3656,7 @@ static void scsi_reset_detect(struct AdapterCtlBlk *acb) ...@@ -3656,7 +3656,7 @@ static void scsi_reset_detect(struct AdapterCtlBlk *acb)
} else { } else {
acb->acb_flag |= RESET_DETECT; acb->acb_flag |= RESET_DETECT;
reset_dev_param(acb); reset_dev_param(acb);
doing_srb_done(acb, DID_RESET, 0, 1); doing_srb_done(acb, DID_RESET, NULL, 1);
/*DC395x_RecoverSRB( acb ); */ /*DC395x_RecoverSRB( acb ); */
acb->active_dcb = NULL; acb->active_dcb = NULL;
acb->acb_flag = 0; acb->acb_flag = 0;
......
...@@ -215,7 +215,7 @@ MODULE_PARM(ips, "s"); ...@@ -215,7 +215,7 @@ MODULE_PARM(ips, "s");
#endif #endif
#else #else
#define IPS_SG_ADDRESS(sg) (page_address((sg)->page) ? \ #define IPS_SG_ADDRESS(sg) (page_address((sg)->page) ? \
page_address((sg)->page)+(sg)->offset : 0) page_address((sg)->page)+(sg)->offset : NULL)
#define IPS_LOCK_SAVE(lock,flags) do{spin_lock(lock);(void)flags;}while(0) #define IPS_LOCK_SAVE(lock,flags) do{spin_lock(lock);(void)flags;}while(0)
#define IPS_UNLOCK_RESTORE(lock,flags) do{spin_unlock(lock);(void)flags;}while(0) #define IPS_UNLOCK_RESTORE(lock,flags) do{spin_unlock(lock);(void)flags;}while(0)
#endif #endif
...@@ -6854,8 +6854,8 @@ ips_abort_init(ips_ha_t * ha, int index) ...@@ -6854,8 +6854,8 @@ ips_abort_init(ips_ha_t * ha, int index)
{ {
ha->active = 0; ha->active = 0;
ips_free(ha); ips_free(ha);
ips_ha[index] = 0; ips_ha[index] = NULL;
ips_sh[index] = 0; ips_sh[index] = NULL;
return -1; return -1;
} }
......
...@@ -238,15 +238,15 @@ int mca_esp_detect(Scsi_Host_Template *tpnt) ...@@ -238,15 +238,15 @@ int mca_esp_detect(Scsi_Host_Template *tpnt)
/* Optional functions */ /* Optional functions */
esp->dma_barrier = 0; esp->dma_barrier = NULL;
esp->dma_drain = 0; esp->dma_drain = NULL;
esp->dma_invalidate = 0; esp->dma_invalidate = NULL;
esp->dma_irq_entry = 0; esp->dma_irq_entry = NULL;
esp->dma_irq_exit = 0; esp->dma_irq_exit = NULL;
esp->dma_led_on = dma_led_on; esp->dma_led_on = dma_led_on;
esp->dma_led_off = dma_led_off; esp->dma_led_off = dma_led_off;
esp->dma_poll = 0; esp->dma_poll = NULL;
esp->dma_reset = 0; esp->dma_reset = NULL;
/* Set the command buffer */ /* Set the command buffer */
......
...@@ -1528,7 +1528,7 @@ nsp_proc_info( ...@@ -1528,7 +1528,7 @@ nsp_proc_info(
thislength = pos - (buffer + offset); thislength = pos - (buffer + offset);
if(thislength < 0) { if(thislength < 0) {
*start = 0; *start = NULL;
return 0; return 0;
} }
......
...@@ -841,7 +841,7 @@ qla2x00_init_rings(scsi_qla_host_t *ha) ...@@ -841,7 +841,7 @@ qla2x00_init_rings(scsi_qla_host_t *ha)
/* Clear outstanding commands array. */ /* Clear outstanding commands array. */
for (cnt = 0; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) for (cnt = 0; cnt < MAX_OUTSTANDING_COMMANDS; cnt++)
ha->outstanding_cmds[cnt] = 0; ha->outstanding_cmds[cnt] = NULL;
ha->current_outstanding_cmd = 0; ha->current_outstanding_cmd = 0;
...@@ -4131,7 +4131,7 @@ qla2x00_abort_isp(scsi_qla_host_t *ha) ...@@ -4131,7 +4131,7 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) { for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
sp = ha->outstanding_cmds[cnt]; sp = ha->outstanding_cmds[cnt];
if (sp) { if (sp) {
ha->outstanding_cmds[cnt] = 0; ha->outstanding_cmds[cnt] = NULL;
if (ha->actthreads) if (ha->actthreads)
ha->actthreads--; ha->actthreads--;
sp->lun_queue->out_cnt--; sp->lun_queue->out_cnt--;
......
...@@ -1155,7 +1155,7 @@ dc390_Disconnect( struct dc390_acb* pACB ) ...@@ -1155,7 +1155,7 @@ dc390_Disconnect( struct dc390_acb* pACB )
} }
DC390_write8 (ScsiCmd, EN_SEL_RESEL); DC390_write8 (ScsiCmd, EN_SEL_RESEL);
pSRB = pDCB->pActiveSRB; pSRB = pDCB->pActiveSRB;
pACB->pActiveDCB = 0; pACB->pActiveDCB = NULL;
pSRB->ScsiPhase = SCSI_NOP0; pSRB->ScsiPhase = SCSI_NOP0;
if( pSRB->SRBState & SRB_UNEXPECT_RESEL ) if( pSRB->SRBState & SRB_UNEXPECT_RESEL )
{ {
...@@ -1175,7 +1175,7 @@ dc390_Disconnect( struct dc390_acb* pACB ) ...@@ -1175,7 +1175,7 @@ dc390_Disconnect( struct dc390_acb* pACB )
dc390_Free_insert (pACB, pSRB); dc390_Free_insert (pACB, pSRB);
pSRB = psrb; pSRB = psrb;
} }
pDCB->pGoingSRB = 0; pDCB->pGoingSRB = NULL;
dc390_Waiting_process (pACB); dc390_Waiting_process (pACB);
} }
else else
...@@ -1204,7 +1204,7 @@ dc390_Disconnect( struct dc390_acb* pACB ) ...@@ -1204,7 +1204,7 @@ dc390_Disconnect( struct dc390_acb* pACB )
{ {
disc1: disc1:
dc390_freetag (pDCB, pSRB); dc390_freetag (pDCB, pSRB);
pDCB->pActiveSRB = 0; pDCB->pActiveSRB = NULL;
pSRB->SRBState = SRB_FREE; pSRB->SRBState = SRB_FREE;
dc390_SRBdone( pACB, pDCB, pSRB); dc390_SRBdone( pACB, pDCB, pSRB);
} }
...@@ -1644,7 +1644,7 @@ dc390_ScsiRstDetect( struct dc390_acb* pACB ) ...@@ -1644,7 +1644,7 @@ dc390_ScsiRstDetect( struct dc390_acb* pACB )
pACB->ACBFlag |= RESET_DETECT; pACB->ACBFlag |= RESET_DETECT;
dc390_ResetDevParam( pACB ); dc390_ResetDevParam( pACB );
dc390_DoingSRB_Done( pACB, 0 ); dc390_DoingSRB_Done( pACB, NULL );
//dc390_RecoverSRB( pACB ); //dc390_RecoverSRB( pACB );
pACB->pActiveDCB = NULL; pACB->pActiveDCB = NULL;
pACB->ACBFlag = 0; pACB->ACBFlag = 0;
......
...@@ -604,12 +604,12 @@ static u8 __devinit dc390_CheckEEpromCheckSum(struct pci_dev *pdev, u8 index) ...@@ -604,12 +604,12 @@ static u8 __devinit dc390_CheckEEpromCheckSum(struct pci_dev *pdev, u8 index)
**********************************************************************/ **********************************************************************/
static struct dc390_dcb __inline__ *dc390_findDCB ( struct dc390_acb* pACB, u8 id, u8 lun) static struct dc390_dcb __inline__ *dc390_findDCB ( struct dc390_acb* pACB, u8 id, u8 lun)
{ {
struct dc390_dcb* pDCB = pACB->pLinkDCB; if (!pDCB) return 0; struct dc390_dcb* pDCB = pACB->pLinkDCB; if (!pDCB) return NULL;
while (pDCB->TargetID != id || pDCB->TargetLUN != lun) while (pDCB->TargetID != id || pDCB->TargetLUN != lun)
{ {
pDCB = pDCB->pNextDCB; pDCB = pDCB->pNextDCB;
if (pDCB == pACB->pLinkDCB) if (pDCB == pACB->pLinkDCB)
return 0; return NULL;
} }
DCBDEBUG1( printk (KERN_DEBUG "DCB %p (%02x,%02x) found.\n", \ DCBDEBUG1( printk (KERN_DEBUG "DCB %p (%02x,%02x) found.\n", \
pDCB, pDCB->TargetID, pDCB->TargetLUN)); pDCB, pDCB->TargetID, pDCB->TargetLUN));
...@@ -1382,7 +1382,7 @@ static void __devinit dc390_set_pci_cfg (struct pci_dev *pdev) ...@@ -1382,7 +1382,7 @@ static void __devinit dc390_set_pci_cfg (struct pci_dev *pdev)
static int dc390_slave_alloc(struct scsi_device *scsi_device) static int dc390_slave_alloc(struct scsi_device *scsi_device)
{ {
struct dc390_acb *pACB = (struct dc390_acb*) scsi_device->host->hostdata; struct dc390_acb *pACB = (struct dc390_acb*) scsi_device->host->hostdata;
struct dc390_dcb *pDCB, *pDCB2 = 0; struct dc390_dcb *pDCB, *pDCB2 = NULL;
uint id = scsi_device->id; uint id = scsi_device->id;
uint lun = scsi_device->lun; uint lun = scsi_device->lun;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment