diff options
author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2011-01-03 17:41:54 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-01-04 22:16:13 -0500 |
commit | 0059005f2cbf4847551b9ad9915ffffe23aef0b9 (patch) | |
tree | ff40c68f8c836d217b81d5c385e4ff2275a335be /drivers/dma | |
parent | 858c21c0f380fb9c78f47f3e372f9baadc54dffe (diff) |
ARM: PL08x: make pl08x_fill_lli_for_desc() return void
We don't need pl08x_fill_lli_for_desc() to return num_llis + 1 as
we know that's what it always does. We can just pass in num_llis
and use post-increment in the caller.
This makes the code slightly easier to read.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/amba-pl08x.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 660165dd945a..f61940434669 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c | |||
@@ -521,9 +521,8 @@ static void pl08x_choose_master_bus(struct pl08x_bus_data *src_bus, | |||
521 | * Fills in one LLI for a certain transfer descriptor | 521 | * Fills in one LLI for a certain transfer descriptor |
522 | * and advance the counter | 522 | * and advance the counter |
523 | */ | 523 | */ |
524 | static int pl08x_fill_lli_for_desc(struct pl08x_driver_data *pl08x, | 524 | static void pl08x_fill_lli_for_desc(struct pl08x_driver_data *pl08x, |
525 | struct pl08x_txd *txd, int num_llis, int len, | 525 | struct pl08x_txd *txd, int num_llis, int len, u32 cctl, u32 *remainder) |
526 | u32 cctl, u32 *remainder) | ||
527 | { | 526 | { |
528 | struct pl08x_lli *llis_va = txd->llis_va; | 527 | struct pl08x_lli *llis_va = txd->llis_va; |
529 | dma_addr_t llis_bus = txd->llis_bus; | 528 | dma_addr_t llis_bus = txd->llis_bus; |
@@ -545,8 +544,6 @@ static int pl08x_fill_lli_for_desc(struct pl08x_driver_data *pl08x, | |||
545 | BUG_ON(*remainder < len); | 544 | BUG_ON(*remainder < len); |
546 | 545 | ||
547 | *remainder -= len; | 546 | *remainder -= len; |
548 | |||
549 | return num_llis + 1; | ||
550 | } | 547 | } |
551 | 548 | ||
552 | /* | 549 | /* |
@@ -646,8 +643,7 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, | |||
646 | "less than a bus width (remain 0x%08x)\n", | 643 | "less than a bus width (remain 0x%08x)\n", |
647 | __func__, remainder); | 644 | __func__, remainder); |
648 | cctl = pl08x_cctl_bits(cctl, 1, 1, 1); | 645 | cctl = pl08x_cctl_bits(cctl, 1, 1, 1); |
649 | num_llis = | 646 | pl08x_fill_lli_for_desc(pl08x, txd, num_llis++, 1, |
650 | pl08x_fill_lli_for_desc(pl08x, txd, num_llis, 1, | ||
651 | cctl, &remainder); | 647 | cctl, &remainder); |
652 | total_bytes++; | 648 | total_bytes++; |
653 | } | 649 | } |
@@ -662,8 +658,8 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, | |||
662 | "(remain 0x%08x)\n", | 658 | "(remain 0x%08x)\n", |
663 | __func__, remainder); | 659 | __func__, remainder); |
664 | cctl = pl08x_cctl_bits(cctl, 1, 1, 1); | 660 | cctl = pl08x_cctl_bits(cctl, 1, 1, 1); |
665 | num_llis = pl08x_fill_lli_for_desc | 661 | pl08x_fill_lli_for_desc(pl08x, txd, num_llis++, 1, |
666 | (pl08x, txd, num_llis, 1, cctl, &remainder); | 662 | cctl, &remainder); |
667 | total_bytes++; | 663 | total_bytes++; |
668 | } | 664 | } |
669 | 665 | ||
@@ -787,9 +783,8 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, | |||
787 | dev_vdbg(&pl08x->adev->dev, | 783 | dev_vdbg(&pl08x->adev->dev, |
788 | "%s fill lli with single lli chunk of size 0x%08zx (remainder 0x%08zx)\n", | 784 | "%s fill lli with single lli chunk of size 0x%08zx (remainder 0x%08zx)\n", |
789 | __func__, lli_len, remainder); | 785 | __func__, lli_len, remainder); |
790 | num_llis = pl08x_fill_lli_for_desc(pl08x, txd, | 786 | pl08x_fill_lli_for_desc(pl08x, txd, num_llis++, |
791 | num_llis, lli_len, cctl, | 787 | lli_len, cctl, &remainder); |
792 | &remainder); | ||
793 | total_bytes += lli_len; | 788 | total_bytes += lli_len; |
794 | } | 789 | } |
795 | 790 | ||
@@ -806,10 +801,9 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, | |||
806 | dev_vdbg(&pl08x->adev->dev, | 801 | dev_vdbg(&pl08x->adev->dev, |
807 | "%s align with boundary, single byte (remain 0x%08zx)\n", | 802 | "%s align with boundary, single byte (remain 0x%08zx)\n", |
808 | __func__, remainder); | 803 | __func__, remainder); |
809 | num_llis = | 804 | pl08x_fill_lli_for_desc(pl08x, txd, |
810 | pl08x_fill_lli_for_desc(pl08x, | 805 | num_llis++, 1, cctl, |
811 | txd, num_llis, 1, | 806 | &remainder); |
812 | cctl, &remainder); | ||
813 | total_bytes++; | 807 | total_bytes++; |
814 | } | 808 | } |
815 | } | 809 | } |
@@ -823,8 +817,8 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, | |||
823 | dev_vdbg(&pl08x->adev->dev, | 817 | dev_vdbg(&pl08x->adev->dev, |
824 | "%s align with boundary, single odd byte (remain %zu)\n", | 818 | "%s align with boundary, single odd byte (remain %zu)\n", |
825 | __func__, remainder); | 819 | __func__, remainder); |
826 | num_llis = pl08x_fill_lli_for_desc(pl08x, txd, num_llis, | 820 | pl08x_fill_lli_for_desc(pl08x, txd, num_llis++, 1, |
827 | 1, cctl, &remainder); | 821 | cctl, &remainder); |
828 | total_bytes++; | 822 | total_bytes++; |
829 | } | 823 | } |
830 | } | 824 | } |