summaryrefslogtreecommitdiff
path: root/drivers/scsi/qla2xxx/qla_bsg.c
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2013-06-25 19:27:23 +0400
committerJames Bottomley <JBottomley@Parallels.com>2013-07-08 20:25:58 +0400
commita44c72f309224973ffc7c7dfeee6e354c6f3d739 (patch)
treeea638beefd9465709fcaaf76a54b83306425f66a /drivers/scsi/qla2xxx/qla_bsg.c
parent090fc2e2cf6a2763f609af6f128a812d5051d935 (diff)
downloadlinux-a44c72f309224973ffc7c7dfeee6e354c6f3d739.tar.xz
[SCSI] qla2xxx: Clean up qla84xx_mgmt_cmd()
Remove dead code, simplify a pointer computation and move the ql84_mgmt assignment to just before its first use. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_bsg.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_bsg.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
index 9a30b696d758..b85f0021db3b 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -1084,14 +1084,6 @@ qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job)
return -EINVAL;
}
- ql84_mgmt = (struct qla_bsg_a84_mgmt *)((char *)bsg_job->request +
- sizeof(struct fc_bsg_request));
- if (!ql84_mgmt) {
- ql_log(ql_log_warn, vha, 0x703b,
- "MGMT header not provided, exiting.\n");
- return -EINVAL;
- }
-
mn = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &mn_dma);
if (!mn) {
ql_log(ql_log_warn, vha, 0x703c,
@@ -1102,7 +1094,7 @@ qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job)
memset(mn, 0, sizeof(struct access_chip_84xx));
mn->entry_type = ACCESS_CHIP_IOCB_TYPE;
mn->entry_count = 1;
-
+ ql84_mgmt = (void *)bsg_job->request + sizeof(struct fc_bsg_request);
switch (ql84_mgmt->mgmt.cmd) {
case QLA84_MGMT_READ_MEM:
case QLA84_MGMT_GET_INFO: