DMA Engine development
 help / color / mirror / Atom feed
From: Joy Chakraborty <joychakr@google.com>
To: Vinod Koul <vkoul@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, manugautam@google.com,
	danielmentz@google.com, sjadavani@google.com,
	Joy Chakraborty <joychakr@google.com>
Subject: [PATCH 4/7] dmaengine: pl330: Change unused arg "len" from get_burst_len()
Date: Thu,  4 May 2023 14:57:34 +0000	[thread overview]
Message-ID: <20230504145737.286444-5-joychakr@google.com> (raw)
In-Reply-To: <20230504145737.286444-1-joychakr@google.com>

Remove unused length argument from get_burst_len() and add burst size as
an argument to allow usage of this function in other places as source and
destination burst sizes are handled separately.

Signed-off-by: Joy Chakraborty <joychakr@google.com>
---
 drivers/dma/pl330.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 746da0bbea92..e5e610c91f18 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2660,8 +2660,7 @@ __pl330_prep_dma_memcpy(struct dma_pl330_chan *pch, dma_addr_t dst,
 	return desc;
 }
 
-/* Call after fixing burst size */
-static inline int get_burst_len(struct dma_pl330_desc *desc, size_t len)
+static inline int get_burst_len(struct dma_pl330_desc *desc, unsigned int brst_size)
 {
 	struct dma_pl330_chan *pch = desc->pchan;
 	struct pl330_dmac *pl330 = pch->dmac;
@@ -2669,7 +2668,7 @@ static inline int get_burst_len(struct dma_pl330_desc *desc, size_t len)
 
 	burst_len = pl330->pcfg.data_bus_width / 8;
 	burst_len *= pl330->pcfg.data_buf_dep / pl330->pcfg.num_chan;
-	burst_len >>= desc->rqcfg.src_brst_size;
+	burst_len >>= brst_size;
 
 	/* src/dst_burst_len can't be more than 16 */
 	if (burst_len > PL330_MAX_BURST)
@@ -2805,7 +2804,7 @@ pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst,
 		burst /= 2;
 
 	desc->rqcfg.src_brst_size = __ffs(burst);
-	desc->rqcfg.src_brst_len = get_burst_len(desc, len);
+	desc->rqcfg.src_brst_len = get_burst_len(desc, desc->rqcfg.src_brst_size);
 	/*
 	 * If burst size is smaller than bus width then make sure we only
 	 * transfer one at a time to avoid a burst stradling an MFIFO entry.
-- 
2.40.1.495.gc816e09b53d-goog


  parent reply	other threads:[~2023-05-04 14:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04 14:57 [PATCH 0/7] dmaengine: pl330: Updates and new quirks for peripheral usecases Joy Chakraborty
2023-05-04 14:57 ` [PATCH 1/7] dmaengine: pl330: Separate SRC and DST burst size and len Joy Chakraborty
2023-05-04 14:57 ` [PATCH 2/7] dmaengine: pl330: Use FFS to calculate burst size Joy Chakraborty
2023-05-04 14:57 ` [PATCH 3/7] dmaengine: pl330: Change if-else to switch-case for consistency Joy Chakraborty
2023-05-04 14:57 ` Joy Chakraborty [this message]
2023-05-04 14:57 ` [PATCH 5/7] dmaengine: pl330: Quirk to optimize AxSize for peripheral usecases Joy Chakraborty
2023-05-04 14:57 ` [PATCH 6/7] dmaengine: pl330: Quirk to use DMA singles for peripheral _dregs Joy Chakraborty
2023-05-04 14:57 ` [PATCH 7/7] dt-bindings: dmaengine: pl330: Add new quirks Joy Chakraborty
2023-05-04 15:08   ` Krzysztof Kozlowski
2023-05-05  9:44     ` Joy Chakraborty
2023-05-05 12:23       ` Krzysztof Kozlowski
2023-05-08 11:58         ` Joy Chakraborty
2023-05-08 16:43           ` Krzysztof Kozlowski
2023-05-11  7:58             ` Joy Chakraborty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230504145737.286444-5-joychakr@google.com \
    --to=joychakr@google.com \
    --cc=danielmentz@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manugautam@google.com \
    --cc=robh+dt@kernel.org \
    --cc=sjadavani@google.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox