Commit 172c122df5186e7cbd413d61757ff90267331002

Authored by Harvey Harrison
Committed by Linus Torvalds
1 parent 8ab68ab420

scsi: fix integer as NULL pointer warnings

drivers/scsi/aic7xxx/aic7770_osm.c:53:58: warning: Using plain integer as NULL pointer
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:355:47: warning: Using plain integer as NULL pointer
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:372:55: warning: Using plain integer as NULL pointer
drivers/scsi/aha152x.c:997:28: warning: Using plain integer as NULL pointer
drivers/scsi/aha152x.c:1003:28: warning: Using plain integer as NULL pointer
drivers/scsi/aha152x.c:1165:46: warning: Using plain integer as NULL pointer
drivers/scsi/fdomain.c:1446:40: warning: Using plain integer as NULL pointer
drivers/scsi/sym53c8xx_2/sym_hipd.c:1650:51: warning: Using plain integer as NULL pointer
drivers/scsi/sym53c8xx_2/sym_hipd.c:3171:42: warning: Using plain integer as NULL pointer
drivers/scsi/sym53c8xx_2/sym_hipd.c:5732:52: warning: Using plain integer as NULL pointer
drivers/scsi/ncr53c8xx.c:8189:31: warning: Using plain integer as NULL pointer
drivers/scsi/ncr53c8xx.c:8225:34: warning: Using plain integer as NULL pointer
drivers/scsi/dpt_i2o.c:156:32: warning: Using plain integer as NULL pointer
drivers/scsi/ultrastor.c:954:42: warning: Using plain integer as NULL pointer
drivers/scsi/ultrastor.c:1104:18: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 8 changed files with 15 additions and 15 deletions Side-by-side Diff

drivers/scsi/aha152x.c
... ... @@ -994,13 +994,13 @@
994 994 SCpnt->SCp.sent_command = 0;
995 995  
996 996 if(SCpnt->SCp.phase & (resetting|check_condition)) {
997   - if(SCpnt->host_scribble==0 || SCSEM(SCpnt) || SCNEXT(SCpnt)) {
  997 + if (!SCpnt->host_scribble || SCSEM(SCpnt) || SCNEXT(SCpnt)) {
998 998 printk(ERR_LEAD "cannot reuse command\n", CMDINFO(SCpnt));
999 999 return FAILED;
1000 1000 }
1001 1001 } else {
1002 1002 SCpnt->host_scribble = kmalloc(sizeof(struct aha152x_scdata), GFP_ATOMIC);
1003   - if(SCpnt->host_scribble==0) {
  1003 + if(!SCpnt->host_scribble) {
1004 1004 printk(ERR_LEAD "allocation failed\n", CMDINFO(SCpnt));
1005 1005 return FAILED;
1006 1006 }
... ... @@ -1162,7 +1162,7 @@
1162 1162 }
1163 1163  
1164 1164 DO_LOCK(flags);
1165   - issued = remove_SC(&ISSUE_SC, SCpnt)==0;
  1165 + issued = remove_SC(&ISSUE_SC, SCpnt) == NULL;
1166 1166 disconnected = issued && remove_SC(&DISCONNECTED_SC, SCpnt);
1167 1167 DO_UNLOCK(flags);
1168 1168  
drivers/scsi/aic7xxx/aic7770_osm.c
... ... @@ -50,7 +50,7 @@
50 50 /*
51 51 * Lock out other contenders for our i/o space.
52 52 */
53   - if (request_region(port, AHC_EISA_IOSIZE, "aic7xxx") == 0)
  53 + if (!request_region(port, AHC_EISA_IOSIZE, "aic7xxx"))
54 54 return (ENOMEM);
55 55 ahc->tag = BUS_SPACE_PIO;
56 56 ahc->bsh.ioport = port;
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
... ... @@ -352,7 +352,7 @@
352 352 *base = pci_resource_start(ahc->dev_softc, 0);
353 353 if (*base == 0)
354 354 return (ENOMEM);
355   - if (request_region(*base, 256, "aic7xxx") == 0)
  355 + if (!request_region(*base, 256, "aic7xxx"))
356 356 return (ENOMEM);
357 357 return (0);
358 358 }
... ... @@ -369,7 +369,7 @@
369 369 start = pci_resource_start(ahc->dev_softc, 1);
370 370 if (start != 0) {
371 371 *bus_addr = start;
372   - if (request_mem_region(start, 0x1000, "aic7xxx") == 0)
  372 + if (!request_mem_region(start, 0x1000, "aic7xxx"))
373 373 error = ENOMEM;
374 374 if (error == 0) {
375 375 *maddr = ioremap_nocache(start, 256);
drivers/scsi/dpt_i2o.c
... ... @@ -153,7 +153,7 @@
153 153  
154 154 static u8 adpt_read_blink_led(adpt_hba* host)
155 155 {
156   - if(host->FwDebugBLEDflag_P != 0) {
  156 + if (host->FwDebugBLEDflag_P) {
157 157 if( readb(host->FwDebugBLEDflag_P) == 0xbc ){
158 158 return readb(host->FwDebugBLEDvalue_P);
159 159 }
drivers/scsi/fdomain.c
... ... @@ -1443,7 +1443,7 @@
1443 1443 current_SC->SCp.this_residual = current_SC->SCp.buffer->length;
1444 1444 current_SC->SCp.buffers_residual = scsi_sg_count(current_SC) - 1;
1445 1445 } else {
1446   - current_SC->SCp.ptr = 0;
  1446 + current_SC->SCp.ptr = NULL;
1447 1447 current_SC->SCp.this_residual = 0;
1448 1448 current_SC->SCp.buffer = NULL;
1449 1449 current_SC->SCp.buffers_residual = 0;
drivers/scsi/ncr53c8xx.c
... ... @@ -8186,7 +8186,7 @@
8186 8186 cmd->next_wcmd = NULL;
8187 8187 if (!(wcmd = np->waiting_list)) np->waiting_list = cmd;
8188 8188 else {
8189   - while ((wcmd->next_wcmd) != 0)
  8189 + while (wcmd->next_wcmd)
8190 8190 wcmd = (struct scsi_cmnd *) wcmd->next_wcmd;
8191 8191 wcmd->next_wcmd = (char *) cmd;
8192 8192 }
... ... @@ -8222,7 +8222,7 @@
8222 8222 #ifdef DEBUG_WAITING_LIST
8223 8223 if (waiting_list) printk("%s: waiting_list=%lx processing sts=%d\n", ncr_name(np), (u_long) waiting_list, sts);
8224 8224 #endif
8225   - while ((wcmd = waiting_list) != 0) {
  8225 + while (wcmd = waiting_list) {
8226 8226 waiting_list = (struct scsi_cmnd *) wcmd->next_wcmd;
8227 8227 wcmd->next_wcmd = NULL;
8228 8228 if (sts == DID_OK) {
drivers/scsi/sym53c8xx_2/sym_hipd.c
... ... @@ -1647,7 +1647,7 @@
1647 1647 SYM_QUEHEAD *qp;
1648 1648 struct sym_ccb *cp;
1649 1649  
1650   - while ((qp = sym_remque_head(&np->comp_ccbq)) != 0) {
  1650 + while ((qp = sym_remque_head(&np->comp_ccbq)) != NULL) {
1651 1651 struct scsi_cmnd *cmd;
1652 1652 cp = sym_que_entry(qp, struct sym_ccb, link_ccbq);
1653 1653 sym_insque_tail(&cp->link_ccbq, &np->busy_ccbq);
... ... @@ -3168,7 +3168,7 @@
3168 3168 * the COMP queue and put back other ones into
3169 3169 * the BUSY queue.
3170 3170 */
3171   - while ((qp = sym_remque_head(&qtmp)) != 0) {
  3171 + while ((qp = sym_remque_head(&qtmp)) != NULL) {
3172 3172 struct scsi_cmnd *cmd;
3173 3173 cp = sym_que_entry(qp, struct sym_ccb, link_ccbq);
3174 3174 cmd = cp->cmd;
... ... @@ -5729,7 +5729,7 @@
5729 5729 sym_mfree_dma(np->dqueue, sizeof(u32)*(MAX_QUEUE*2), "DQUEUE");
5730 5730  
5731 5731 if (np->actccbs) {
5732   - while ((qp = sym_remque_head(&np->free_ccbq)) != 0) {
  5732 + while ((qp = sym_remque_head(&np->free_ccbq)) != NULL) {
5733 5733 cp = sym_que_entry(qp, struct sym_ccb, link_ccbq);
5734 5734 sym_mfree_dma(cp, sizeof(*cp), "CCB");
5735 5735 }
drivers/scsi/ultrastor.c
... ... @@ -951,7 +951,7 @@
951 951 printk("abort: command mismatch, %p != %p\n",
952 952 config.mscp[mscp_index].SCint, SCpnt);
953 953 #endif
954   - if (config.mscp[mscp_index].SCint == 0)
  954 + if (config.mscp[mscp_index].SCint == NULL)
955 955 return FAILED;
956 956  
957 957 if (config.mscp[mscp_index].SCint != SCpnt) panic("Bad abort");
... ... @@ -1101,7 +1101,7 @@
1101 1101 SCtmp = mscp->SCint;
1102 1102 mscp->SCint = NULL;
1103 1103  
1104   - if (SCtmp == 0)
  1104 + if (!SCtmp)
1105 1105 {
1106 1106 #if ULTRASTOR_DEBUG & (UD_ABORT|UD_INTERRUPT)
1107 1107 printk("MSCP %d (%x): no command\n", mscp_index, (unsigned int) mscp);