Skip to content

Commit da31df8

Browse files
Raghava Aditya Renukuntamartinkpetersen
authored andcommitted
aacraid: Removed unnecessary checks for NULL
Current driver checks for NULL return from aac_fib_alloc_tag, but it not possible for it to return NULL. Fixed by: Remove all the checks for NULL returns from aac_fib_alloc_tag Suggested-by: Tomas Henzl <[email protected]> Signed-off-by: Raghava Aditya Renukunta <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 1354379 commit da31df8

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

drivers/scsi/aacraid/aachba.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,6 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd)
555555
dev = (struct aac_dev *)scsicmd->device->host->hostdata;
556556

557557
cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
558-
if (!cmd_fibcontext)
559-
return -ENOMEM;
560558

561559
aac_fib_init(cmd_fibcontext);
562560
dinfo = (struct aac_get_name *) fib_data(cmd_fibcontext);
@@ -1037,8 +1035,6 @@ static int aac_get_container_serial(struct scsi_cmnd * scsicmd)
10371035
dev = (struct aac_dev *)scsicmd->device->host->hostdata;
10381036

10391037
cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
1040-
if (!cmd_fibcontext)
1041-
return -ENOMEM;
10421038

10431039
aac_fib_init(cmd_fibcontext);
10441040
dinfo = (struct aac_get_serial *) fib_data(cmd_fibcontext);
@@ -1950,10 +1946,6 @@ static int aac_read(struct scsi_cmnd * scsicmd)
19501946
* Alocate and initialize a Fib
19511947
*/
19521948
cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
1953-
if (!cmd_fibcontext) {
1954-
printk(KERN_WARNING "aac_read: fib allocation failed\n");
1955-
return -1;
1956-
}
19571949

19581950
status = aac_adapter_read(cmd_fibcontext, scsicmd, lba, count);
19591951

@@ -2048,16 +2040,6 @@ static int aac_write(struct scsi_cmnd * scsicmd)
20482040
* Allocate and initialize a Fib then setup a BlockWrite command
20492041
*/
20502042
cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
2051-
if (!cmd_fibcontext) {
2052-
/* FIB temporarily unavailable,not catastrophic failure */
2053-
2054-
/* scsicmd->result = DID_ERROR << 16;
2055-
* scsicmd->scsi_done(scsicmd);
2056-
* return 0;
2057-
*/
2058-
printk(KERN_WARNING "aac_write: fib allocation failed\n");
2059-
return -1;
2060-
}
20612043

20622044
status = aac_adapter_write(cmd_fibcontext, scsicmd, lba, count, fua);
20632045

@@ -2283,8 +2265,6 @@ static int aac_start_stop(struct scsi_cmnd *scsicmd)
22832265
* Allocate and initialize a Fib
22842266
*/
22852267
cmd_fibcontext = aac_fib_alloc_tag(aac, scsicmd);
2286-
if (!cmd_fibcontext)
2287-
return SCSI_MLQUEUE_HOST_BUSY;
22882268

22892269
aac_fib_init(cmd_fibcontext);
22902270

@@ -3184,8 +3164,6 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
31843164
* Allocate and initialize a Fib then setup a BlockWrite command
31853165
*/
31863166
cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd);
3187-
if (!cmd_fibcontext)
3188-
return -1;
31893167

31903168
status = aac_adapter_scsi(cmd_fibcontext, scsicmd);
31913169

0 commit comments

Comments
 (0)