diff options
author | Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> | 2016-04-26 02:30:55 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-04-29 19:08:24 -0400 |
commit | da31df8c7285910ee8c8629d901b34a480ab0005 (patch) | |
tree | 266670d4ca8430f51917f5d805e7204202748b02 /drivers/scsi | |
parent | 1354379b13f190ae5da21c26836a16ba56566ab3 (diff) |
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 <thenzl@redhat.com>
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/aacraid/aachba.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 7dfd0fa27255..6678d1fd897b 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c | |||
@@ -555,8 +555,6 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd) | |||
555 | dev = (struct aac_dev *)scsicmd->device->host->hostdata; | 555 | dev = (struct aac_dev *)scsicmd->device->host->hostdata; |
556 | 556 | ||
557 | cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd); | 557 | cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd); |
558 | if (!cmd_fibcontext) | ||
559 | return -ENOMEM; | ||
560 | 558 | ||
561 | aac_fib_init(cmd_fibcontext); | 559 | aac_fib_init(cmd_fibcontext); |
562 | dinfo = (struct aac_get_name *) fib_data(cmd_fibcontext); | 560 | dinfo = (struct aac_get_name *) fib_data(cmd_fibcontext); |
@@ -1037,8 +1035,6 @@ static int aac_get_container_serial(struct scsi_cmnd * scsicmd) | |||
1037 | dev = (struct aac_dev *)scsicmd->device->host->hostdata; | 1035 | dev = (struct aac_dev *)scsicmd->device->host->hostdata; |
1038 | 1036 | ||
1039 | cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd); | 1037 | cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd); |
1040 | if (!cmd_fibcontext) | ||
1041 | return -ENOMEM; | ||
1042 | 1038 | ||
1043 | aac_fib_init(cmd_fibcontext); | 1039 | aac_fib_init(cmd_fibcontext); |
1044 | dinfo = (struct aac_get_serial *) fib_data(cmd_fibcontext); | 1040 | dinfo = (struct aac_get_serial *) fib_data(cmd_fibcontext); |
@@ -1950,10 +1946,6 @@ static int aac_read(struct scsi_cmnd * scsicmd) | |||
1950 | * Alocate and initialize a Fib | 1946 | * Alocate and initialize a Fib |
1951 | */ | 1947 | */ |
1952 | cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd); | 1948 | 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 | } | ||
1957 | 1949 | ||
1958 | status = aac_adapter_read(cmd_fibcontext, scsicmd, lba, count); | 1950 | status = aac_adapter_read(cmd_fibcontext, scsicmd, lba, count); |
1959 | 1951 | ||
@@ -2048,16 +2040,6 @@ static int aac_write(struct scsi_cmnd * scsicmd) | |||
2048 | * Allocate and initialize a Fib then setup a BlockWrite command | 2040 | * Allocate and initialize a Fib then setup a BlockWrite command |
2049 | */ | 2041 | */ |
2050 | cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd); | 2042 | 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 | } | ||
2061 | 2043 | ||
2062 | status = aac_adapter_write(cmd_fibcontext, scsicmd, lba, count, fua); | 2044 | status = aac_adapter_write(cmd_fibcontext, scsicmd, lba, count, fua); |
2063 | 2045 | ||
@@ -2283,8 +2265,6 @@ static int aac_start_stop(struct scsi_cmnd *scsicmd) | |||
2283 | * Allocate and initialize a Fib | 2265 | * Allocate and initialize a Fib |
2284 | */ | 2266 | */ |
2285 | cmd_fibcontext = aac_fib_alloc_tag(aac, scsicmd); | 2267 | cmd_fibcontext = aac_fib_alloc_tag(aac, scsicmd); |
2286 | if (!cmd_fibcontext) | ||
2287 | return SCSI_MLQUEUE_HOST_BUSY; | ||
2288 | 2268 | ||
2289 | aac_fib_init(cmd_fibcontext); | 2269 | aac_fib_init(cmd_fibcontext); |
2290 | 2270 | ||
@@ -3184,8 +3164,6 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd) | |||
3184 | * Allocate and initialize a Fib then setup a BlockWrite command | 3164 | * Allocate and initialize a Fib then setup a BlockWrite command |
3185 | */ | 3165 | */ |
3186 | cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd); | 3166 | cmd_fibcontext = aac_fib_alloc_tag(dev, scsicmd); |
3187 | if (!cmd_fibcontext) | ||
3188 | return -1; | ||
3189 | 3167 | ||
3190 | status = aac_adapter_scsi(cmd_fibcontext, scsicmd); | 3168 | status = aac_adapter_scsi(cmd_fibcontext, scsicmd); |
3191 | 3169 | ||