diff options
Diffstat (limited to 'drivers/scsi/ipr.c')
-rw-r--r-- | drivers/scsi/ipr.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index b41dfb539021..c316a0bcae6c 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -5134,6 +5134,7 @@ static void ipr_build_ata_ioadl(struct ipr_cmnd *ipr_cmd, | |||
5134 | u32 ioadl_flags = 0; | 5134 | u32 ioadl_flags = 0; |
5135 | struct ipr_ioarcb *ioarcb = &ipr_cmd->ioarcb; | 5135 | struct ipr_ioarcb *ioarcb = &ipr_cmd->ioarcb; |
5136 | struct ipr_ioadl_desc *ioadl = ipr_cmd->ioadl; | 5136 | struct ipr_ioadl_desc *ioadl = ipr_cmd->ioadl; |
5137 | struct ipr_ioadl_desc *last_ioadl = NULL; | ||
5137 | int len = qc->nbytes + qc->pad_len; | 5138 | int len = qc->nbytes + qc->pad_len; |
5138 | struct scatterlist *sg; | 5139 | struct scatterlist *sg; |
5139 | 5140 | ||
@@ -5156,11 +5157,13 @@ static void ipr_build_ata_ioadl(struct ipr_cmnd *ipr_cmd, | |||
5156 | ata_for_each_sg(sg, qc) { | 5157 | ata_for_each_sg(sg, qc) { |
5157 | ioadl->flags_and_data_len = cpu_to_be32(ioadl_flags | sg_dma_len(sg)); | 5158 | ioadl->flags_and_data_len = cpu_to_be32(ioadl_flags | sg_dma_len(sg)); |
5158 | ioadl->address = cpu_to_be32(sg_dma_address(sg)); | 5159 | ioadl->address = cpu_to_be32(sg_dma_address(sg)); |
5159 | if (ata_sg_is_last(sg, qc)) | 5160 | |
5160 | ioadl->flags_and_data_len |= cpu_to_be32(IPR_IOADL_FLAGS_LAST); | 5161 | last_ioadl = ioadl; |
5161 | else | 5162 | ioadl++; |
5162 | ioadl++; | ||
5163 | } | 5163 | } |
5164 | |||
5165 | if (likely(last_ioadl)) | ||
5166 | last_ioadl->flags_and_data_len |= cpu_to_be32(IPR_IOADL_FLAGS_LAST); | ||
5164 | } | 5167 | } |
5165 | 5168 | ||
5166 | /** | 5169 | /** |