diff options
author | Quinn Tran <quinn.tran@qlogic.com> | 2014-06-02 07:02:16 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-06-02 12:40:48 -0400 |
commit | c7ee3bd4870ef1d96a1202f92ce858f849670a62 (patch) | |
tree | 806874ae34cbe2835ca70f4ebb4abcb84e759674 | |
parent | 3fb4b161e0eeb5abc1c3bff2b72d784a23321a5b (diff) |
qla2xxx: fix sparse warnings introduced by previous target mode t10-dif patch
Fix sparse warnings introduce by "qla2xxx: T10-Dif: add T10-PI support".
Signed-off-by: Quinn Tran <quinn.tran@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 16 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.c | 15 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.h | 16 |
3 files changed, 26 insertions, 21 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 1fa010448666..de5d0ae19d83 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -1648,16 +1648,16 @@ typedef struct { | |||
1648 | */ | 1648 | */ |
1649 | struct crc_context { | 1649 | struct crc_context { |
1650 | uint32_t handle; /* System handle. */ | 1650 | uint32_t handle; /* System handle. */ |
1651 | uint32_t ref_tag; | 1651 | __le32 ref_tag; |
1652 | uint16_t app_tag; | 1652 | __le16 app_tag; |
1653 | uint8_t ref_tag_mask[4]; /* Validation/Replacement Mask*/ | 1653 | uint8_t ref_tag_mask[4]; /* Validation/Replacement Mask*/ |
1654 | uint8_t app_tag_mask[2]; /* Validation/Replacement Mask*/ | 1654 | uint8_t app_tag_mask[2]; /* Validation/Replacement Mask*/ |
1655 | uint16_t guard_seed; /* Initial Guard Seed */ | 1655 | __le16 guard_seed; /* Initial Guard Seed */ |
1656 | uint16_t prot_opts; /* Requested Data Protection Mode */ | 1656 | __le16 prot_opts; /* Requested Data Protection Mode */ |
1657 | uint16_t blk_size; /* Data size in bytes */ | 1657 | __le16 blk_size; /* Data size in bytes */ |
1658 | uint16_t runt_blk_guard; /* Guard value for runt block (tape | 1658 | uint16_t runt_blk_guard; /* Guard value for runt block (tape |
1659 | * only) */ | 1659 | * only) */ |
1660 | uint32_t byte_count; /* Total byte count/ total data | 1660 | __le32 byte_count; /* Total byte count/ total data |
1661 | * transfer count */ | 1661 | * transfer count */ |
1662 | union { | 1662 | union { |
1663 | struct { | 1663 | struct { |
@@ -1671,10 +1671,10 @@ struct crc_context { | |||
1671 | uint32_t reserved_6; | 1671 | uint32_t reserved_6; |
1672 | } nobundling; | 1672 | } nobundling; |
1673 | struct { | 1673 | struct { |
1674 | uint32_t dif_byte_count; /* Total DIF byte | 1674 | __le32 dif_byte_count; /* Total DIF byte |
1675 | * count */ | 1675 | * count */ |
1676 | uint16_t reserved_1; | 1676 | uint16_t reserved_1; |
1677 | uint16_t dseg_count; /* Data segment count */ | 1677 | __le16 dseg_count; /* Data segment count */ |
1678 | uint32_t reserved_2; | 1678 | uint32_t reserved_2; |
1679 | uint32_t data_address[2]; | 1679 | uint32_t data_address[2]; |
1680 | uint32_t data_length; | 1680 | uint32_t data_length; |
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index b1d10f9935c7..2619ed45cbdc 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c | |||
@@ -1997,7 +1997,7 @@ qlt_set_t10dif_tags(struct se_cmd *se_cmd, struct crc_context *ctx) | |||
1997 | * have been immplemented by TCM, before AppTag is avail. | 1997 | * have been immplemented by TCM, before AppTag is avail. |
1998 | * Look for modesense_handlers[] | 1998 | * Look for modesense_handlers[] |
1999 | */ | 1999 | */ |
2000 | ctx->app_tag = __constant_cpu_to_le16(0); | 2000 | ctx->app_tag = 0; |
2001 | ctx->app_tag_mask[0] = 0x0; | 2001 | ctx->app_tag_mask[0] = 0x0; |
2002 | ctx->app_tag_mask[1] = 0x0; | 2002 | ctx->app_tag_mask[1] = 0x0; |
2003 | 2003 | ||
@@ -2079,6 +2079,7 @@ qlt_build_ctio_crc2_pkt(struct qla_tgt_prm *prm, scsi_qla_host_t *vha) | |||
2079 | struct se_cmd *se_cmd = &cmd->se_cmd; | 2079 | struct se_cmd *se_cmd = &cmd->se_cmd; |
2080 | uint32_t h; | 2080 | uint32_t h; |
2081 | struct atio_from_isp *atio = &prm->cmd->atio; | 2081 | struct atio_from_isp *atio = &prm->cmd->atio; |
2082 | uint16_t t16; | ||
2082 | 2083 | ||
2083 | sgc = 0; | 2084 | sgc = 0; |
2084 | ha = vha->hw; | 2085 | ha = vha->hw; |
@@ -2175,8 +2176,13 @@ qlt_build_ctio_crc2_pkt(struct qla_tgt_prm *prm, scsi_qla_host_t *vha) | |||
2175 | pkt->initiator_id[1] = atio->u.isp24.fcp_hdr.s_id[1]; | 2176 | pkt->initiator_id[1] = atio->u.isp24.fcp_hdr.s_id[1]; |
2176 | pkt->initiator_id[2] = atio->u.isp24.fcp_hdr.s_id[0]; | 2177 | pkt->initiator_id[2] = atio->u.isp24.fcp_hdr.s_id[0]; |
2177 | pkt->exchange_addr = atio->u.isp24.exchange_addr; | 2178 | pkt->exchange_addr = atio->u.isp24.exchange_addr; |
2178 | pkt->ox_id = swab16(atio->u.isp24.fcp_hdr.ox_id); | 2179 | |
2179 | pkt->flags |= (atio->u.isp24.attr << 9); | 2180 | /* silence compile warning */ |
2181 | t16 = be16_to_cpu(atio->u.isp24.fcp_hdr.ox_id); | ||
2182 | pkt->ox_id = cpu_to_le16(t16); | ||
2183 | |||
2184 | t16 = (atio->u.isp24.attr << 9); | ||
2185 | pkt->flags |= cpu_to_le16(t16); | ||
2180 | pkt->relative_offset = cpu_to_le32(prm->cmd->offset); | 2186 | pkt->relative_offset = cpu_to_le32(prm->cmd->offset); |
2181 | 2187 | ||
2182 | /* Set transfer direction */ | 2188 | /* Set transfer direction */ |
@@ -2251,8 +2257,7 @@ qlt_build_ctio_crc2_pkt(struct qla_tgt_prm *prm, scsi_qla_host_t *vha) | |||
2251 | 2257 | ||
2252 | if (bundling && prm->prot_seg_cnt) { | 2258 | if (bundling && prm->prot_seg_cnt) { |
2253 | /* Walks dif segments */ | 2259 | /* Walks dif segments */ |
2254 | pkt->add_flags |= | 2260 | pkt->add_flags |= CTIO_CRC2_AF_DIF_DSD_ENA; |
2255 | __constant_cpu_to_le16(CTIO_CRC2_AF_DIF_DSD_ENA); | ||
2256 | 2261 | ||
2257 | cur_dsd = (uint32_t *) &crc_ctx_pkt->u.bundling.dif_address; | 2262 | cur_dsd = (uint32_t *) &crc_ctx_pkt->u.bundling.dif_address; |
2258 | if (qla24xx_walk_and_build_prot_sglist(ha, NULL, cur_dsd, | 2263 | if (qla24xx_walk_and_build_prot_sglist(ha, NULL, cur_dsd, |
diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h index f873e10451d2..fa5630b469f3 100644 --- a/drivers/scsi/qla2xxx/qla_target.h +++ b/drivers/scsi/qla2xxx/qla_target.h | |||
@@ -316,7 +316,7 @@ struct fcp_hdr { | |||
316 | uint8_t seq_id; | 316 | uint8_t seq_id; |
317 | uint8_t df_ctl; | 317 | uint8_t df_ctl; |
318 | uint16_t seq_cnt; | 318 | uint16_t seq_cnt; |
319 | uint16_t ox_id; | 319 | __be16 ox_id; |
320 | uint16_t rx_id; | 320 | uint16_t rx_id; |
321 | uint32_t parameter; | 321 | uint32_t parameter; |
322 | } __packed; | 322 | } __packed; |
@@ -441,7 +441,7 @@ struct ctio7_to_24xx { | |||
441 | union { | 441 | union { |
442 | struct { | 442 | struct { |
443 | uint16_t reserved1; | 443 | uint16_t reserved1; |
444 | uint16_t flags; | 444 | __le16 flags; |
445 | uint32_t residual; | 445 | uint32_t residual; |
446 | uint16_t ox_id; | 446 | uint16_t ox_id; |
447 | uint16_t scsi_status; | 447 | uint16_t scsi_status; |
@@ -527,7 +527,7 @@ struct ctio_crc2_to_fw { | |||
527 | 527 | ||
528 | uint32_t handle; /* System handle. */ | 528 | uint32_t handle; /* System handle. */ |
529 | uint16_t nport_handle; /* N_PORT handle. */ | 529 | uint16_t nport_handle; /* N_PORT handle. */ |
530 | uint16_t timeout; /* Command timeout. */ | 530 | __le16 timeout; /* Command timeout. */ |
531 | 531 | ||
532 | uint16_t dseg_count; /* Data segment count. */ | 532 | uint16_t dseg_count; /* Data segment count. */ |
533 | uint8_t vp_index; | 533 | uint8_t vp_index; |
@@ -538,15 +538,15 @@ struct ctio_crc2_to_fw { | |||
538 | uint8_t reserved1; | 538 | uint8_t reserved1; |
539 | uint32_t exchange_addr; /* rcv exchange address */ | 539 | uint32_t exchange_addr; /* rcv exchange address */ |
540 | uint16_t reserved2; | 540 | uint16_t reserved2; |
541 | uint16_t flags; /* refer to CTIO7 flags values */ | 541 | __le16 flags; /* refer to CTIO7 flags values */ |
542 | uint32_t residual; | 542 | uint32_t residual; |
543 | uint16_t ox_id; | 543 | __le16 ox_id; |
544 | uint16_t scsi_status; | 544 | uint16_t scsi_status; |
545 | uint32_t relative_offset; | 545 | __le32 relative_offset; |
546 | uint32_t reserved5; | 546 | uint32_t reserved5; |
547 | uint32_t transfer_length; /* total fc transfer length */ | 547 | __le32 transfer_length; /* total fc transfer length */ |
548 | uint32_t reserved6; | 548 | uint32_t reserved6; |
549 | uint32_t crc_context_address[2];/* Data segment address. */ | 549 | __le32 crc_context_address[2];/* Data segment address. */ |
550 | uint16_t crc_context_len; /* Data segment length. */ | 550 | uint16_t crc_context_len; /* Data segment length. */ |
551 | uint16_t reserved_1; /* MUST be set to 0. */ | 551 | uint16_t reserved_1; /* MUST be set to 0. */ |
552 | } __packed; | 552 | } __packed; |