diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2009-05-15 07:18:17 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-05-23 16:44:15 -0400 |
commit | bc90c8632f63cd94246e3fb6f1b6d7ecba48f1a0 (patch) | |
tree | 024cffea447761a6c0e1ed814c87b9c02509b3e4 | |
parent | a40a1bafe7da0afe61b1c20fc50e18c07ce724f9 (diff) |
[SCSI] zfcp: Remove unnecessary default case and assignments
enum dma_data_direction only has the 4 values DMA_BIDIRECTIONAL,
DMA_TO_DEVICE, DMA_FROM_DEVICE and DMA_NONE. No need to have the
default case. While changing this, setup sbtype in one place to make
sparse happy.
The default value of retval is already -EIO, so remove the
additional assignment for these two cases.
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 74dee32afba8..8411730d44ba 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -2314,7 +2314,7 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit, | |||
2314 | { | 2314 | { |
2315 | struct zfcp_fsf_req *req; | 2315 | struct zfcp_fsf_req *req; |
2316 | struct fcp_cmnd_iu *fcp_cmnd_iu; | 2316 | struct fcp_cmnd_iu *fcp_cmnd_iu; |
2317 | unsigned int sbtype; | 2317 | unsigned int sbtype = SBAL_FLAGS0_TYPE_READ; |
2318 | int real_bytes, retval = -EIO; | 2318 | int real_bytes, retval = -EIO; |
2319 | struct zfcp_adapter *adapter = unit->port->adapter; | 2319 | struct zfcp_adapter *adapter = unit->port->adapter; |
2320 | 2320 | ||
@@ -2356,11 +2356,9 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit, | |||
2356 | switch (scsi_cmnd->sc_data_direction) { | 2356 | switch (scsi_cmnd->sc_data_direction) { |
2357 | case DMA_NONE: | 2357 | case DMA_NONE: |
2358 | req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND; | 2358 | req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND; |
2359 | sbtype = SBAL_FLAGS0_TYPE_READ; | ||
2360 | break; | 2359 | break; |
2361 | case DMA_FROM_DEVICE: | 2360 | case DMA_FROM_DEVICE: |
2362 | req->qtcb->bottom.io.data_direction = FSF_DATADIR_READ; | 2361 | req->qtcb->bottom.io.data_direction = FSF_DATADIR_READ; |
2363 | sbtype = SBAL_FLAGS0_TYPE_READ; | ||
2364 | fcp_cmnd_iu->rddata = 1; | 2362 | fcp_cmnd_iu->rddata = 1; |
2365 | break; | 2363 | break; |
2366 | case DMA_TO_DEVICE: | 2364 | case DMA_TO_DEVICE: |
@@ -2369,8 +2367,6 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit, | |||
2369 | fcp_cmnd_iu->wddata = 1; | 2367 | fcp_cmnd_iu->wddata = 1; |
2370 | break; | 2368 | break; |
2371 | case DMA_BIDIRECTIONAL: | 2369 | case DMA_BIDIRECTIONAL: |
2372 | default: | ||
2373 | retval = -EIO; | ||
2374 | goto failed_scsi_cmnd; | 2370 | goto failed_scsi_cmnd; |
2375 | } | 2371 | } |
2376 | 2372 | ||
@@ -2394,9 +2390,7 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit, | |||
2394 | scsi_sglist(scsi_cmnd), | 2390 | scsi_sglist(scsi_cmnd), |
2395 | FSF_MAX_SBALS_PER_REQ); | 2391 | FSF_MAX_SBALS_PER_REQ); |
2396 | if (unlikely(real_bytes < 0)) { | 2392 | if (unlikely(real_bytes < 0)) { |
2397 | if (req->sbal_number < FSF_MAX_SBALS_PER_REQ) | 2393 | if (req->sbal_number >= FSF_MAX_SBALS_PER_REQ) { |
2398 | retval = -EIO; | ||
2399 | else { | ||
2400 | dev_err(&adapter->ccw_device->dev, | 2394 | dev_err(&adapter->ccw_device->dev, |
2401 | "Oversize data package, unit 0x%016Lx " | 2395 | "Oversize data package, unit 0x%016Lx " |
2402 | "on port 0x%016Lx closed\n", | 2396 | "on port 0x%016Lx closed\n", |