summaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>2013-05-28 02:43:23 +0400
committerTejun Heo <tj@kernel.org>2013-05-28 09:18:08 +0900
commit333279c82b984f3eac61feff2b76a8b79e3db6c8 (patch)
tree46b7cfd948671f77e729867c93e70c9ee125c6b3 /drivers/ata
parent5c23341ff66c9280c2e76dc9795cd14497ea780f (diff)
downloadblackbird-op-linux-333279c82b984f3eac61feff2b76a8b79e3db6c8.tar.gz
blackbird-op-linux-333279c82b984f3eac61feff2b76a8b79e3db6c8.zip
sata_rcar: kill superfluous code in sata_rcar_bmdma_fill_sg()
I've modified sata_rcar_bmdma_fill_sg() to take care of splitting long scatter/ gather segments due to the descriptor table transfer counter being only 28 bits wide (bit 1 to bit 28) but that was in vain as even if 'sata_rcar_sht' specified a correct 'dma_boundary' field, the DMA and block layers would have split the S/G segments on the necassary boundaries. Since the driver uses ATA_BMDMA_SHT() to initilaize 'sata_rcar_sht', the boundary is much smaller, only 0xFFFF, so the code I've added is even more useless, and it's better to just remove it. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/sata_rcar.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 889c25a6337e..629b07c452c5 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -474,11 +474,10 @@ static void sata_rcar_bmdma_fill_sg(struct ata_queued_cmd *qc)
struct ata_port *ap = qc->ap;
struct ata_bmdma_prd *prd = ap->bmdma_prd;
struct scatterlist *sg;
- unsigned int si, pi;
+ unsigned int si;
- pi = 0;
for_each_sg(qc->sg, sg, qc->n_elem, si) {
- u32 addr, sg_len, len;
+ u32 addr, sg_len;
/*
* Note: h/w doesn't support 64-bit, so we unconditionally
@@ -487,24 +486,13 @@ static void sata_rcar_bmdma_fill_sg(struct ata_queued_cmd *qc)
addr = (u32)sg_dma_address(sg);
sg_len = sg_dma_len(sg);
- /* H/w transfer count is only 29 bits long, let's be careful */
- while (sg_len) {
- len = sg_len;
- if (len > 0x1ffffffe)
- len = 0x1ffffffe;
-
- prd[pi].addr = cpu_to_le32(addr);
- prd[pi].flags_len = cpu_to_le32(len);
- VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", pi, addr, len);
-
- pi++;
- sg_len -= len;
- addr += len;
- }
+ prd[si].addr = cpu_to_le32(addr);
+ prd[si].flags_len = cpu_to_le32(sg_len);
+ VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", si, addr, sg_len);
}
/* end-of-table flag */
- prd[pi - 1].addr |= cpu_to_le32(SATA_RCAR_DTEND);
+ prd[si - 1].addr |= cpu_to_le32(SATA_RCAR_DTEND);
}
static void sata_rcar_qc_prep(struct ata_queued_cmd *qc)
OpenPOWER on IntegriCloud