Commit bc90c863 authored by Christof Schmitt's avatar Christof Schmitt Committed by James Bottomley

[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: default avatarSwen Schillig <swen@vnet.ibm.com>
Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent a40a1baf
...@@ -2314,7 +2314,7 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit, ...@@ -2314,7 +2314,7 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit,
{ {
struct zfcp_fsf_req *req; struct zfcp_fsf_req *req;
struct fcp_cmnd_iu *fcp_cmnd_iu; struct fcp_cmnd_iu *fcp_cmnd_iu;
unsigned int sbtype; unsigned int sbtype = SBAL_FLAGS0_TYPE_READ;
int real_bytes, retval = -EIO; int real_bytes, retval = -EIO;
struct zfcp_adapter *adapter = unit->port->adapter; struct zfcp_adapter *adapter = unit->port->adapter;
...@@ -2356,11 +2356,9 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit, ...@@ -2356,11 +2356,9 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit,
switch (scsi_cmnd->sc_data_direction) { switch (scsi_cmnd->sc_data_direction) {
case DMA_NONE: case DMA_NONE:
req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND; req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND;
sbtype = SBAL_FLAGS0_TYPE_READ;
break; break;
case DMA_FROM_DEVICE: case DMA_FROM_DEVICE:
req->qtcb->bottom.io.data_direction = FSF_DATADIR_READ; req->qtcb->bottom.io.data_direction = FSF_DATADIR_READ;
sbtype = SBAL_FLAGS0_TYPE_READ;
fcp_cmnd_iu->rddata = 1; fcp_cmnd_iu->rddata = 1;
break; break;
case DMA_TO_DEVICE: case DMA_TO_DEVICE:
...@@ -2369,8 +2367,6 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit, ...@@ -2369,8 +2367,6 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit,
fcp_cmnd_iu->wddata = 1; fcp_cmnd_iu->wddata = 1;
break; break;
case DMA_BIDIRECTIONAL: case DMA_BIDIRECTIONAL:
default:
retval = -EIO;
goto failed_scsi_cmnd; goto failed_scsi_cmnd;
} }
...@@ -2394,9 +2390,7 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit, ...@@ -2394,9 +2390,7 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit,
scsi_sglist(scsi_cmnd), scsi_sglist(scsi_cmnd),
FSF_MAX_SBALS_PER_REQ); FSF_MAX_SBALS_PER_REQ);
if (unlikely(real_bytes < 0)) { if (unlikely(real_bytes < 0)) {
if (req->sbal_number < FSF_MAX_SBALS_PER_REQ) if (req->sbal_number >= FSF_MAX_SBALS_PER_REQ) {
retval = -EIO;
else {
dev_err(&adapter->ccw_device->dev, dev_err(&adapter->ccw_device->dev,
"Oversize data package, unit 0x%016Lx " "Oversize data package, unit 0x%016Lx "
"on port 0x%016Lx closed\n", "on port 0x%016Lx closed\n",
......
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