From: Joy Chakraborty <joychakr@google.com>
To: Vinod Koul <vkoul@kernel.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 v2 3/6] dmaengine: pl330: Change if-else to switch-case for consistency
Date: Fri, 12 May 2023 14:14:42 +0000 [thread overview]
Message-ID: <20230512141445.2026660-4-joychakr@google.com> (raw)
In-Reply-To: <20230512141445.2026660-1-joychakr@google.com>
Change if-else to switch-case in pl330_prep_slave_sg() function for
consistency with other peripheral transfer functions in the driver.
Signed-off-by: Joy Chakraborty <joychakr@google.com>
---
drivers/dma/pl330.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 39a66ff29e27..746da0bbea92 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2883,16 +2883,21 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
else
list_add_tail(&desc->node, &first->node);
- if (direction == DMA_MEM_TO_DEV) {
+ switch (direction) {
+ case DMA_MEM_TO_DEV:
desc->rqcfg.src_inc = 1;
desc->rqcfg.dst_inc = 0;
fill_px(&desc->px, pch->fifo_dma, sg_dma_address(sg),
sg_dma_len(sg));
- } else {
+ break;
+ case DMA_DEV_TO_MEM:
desc->rqcfg.src_inc = 0;
desc->rqcfg.dst_inc = 1;
fill_px(&desc->px, sg_dma_address(sg), pch->fifo_dma,
sg_dma_len(sg));
+ break;
+ default:
+ break;
}
desc->rqcfg.src_brst_size = pch->burst_sz;
--
2.40.1.606.ga4b1b128d6-goog
next prev parent reply other threads:[~2023-05-12 14:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-12 14:14 [PATCH v2 0/6] dmaengine: pl330: Updates and logical changes for peripheral usecases Joy Chakraborty
2023-05-12 14:14 ` [PATCH v2 1/6] dmaengine: pl330: Separate SRC and DST burst size and len Joy Chakraborty
2023-05-12 14:14 ` [PATCH v2 2/6] dmaengine: pl330: Use FFS to calculate burst size Joy Chakraborty
2023-05-12 14:14 ` Joy Chakraborty [this message]
2023-05-12 14:14 ` [PATCH v2 4/6] dmaengine: pl330: Change unused arg "len" from get_burst_len() Joy Chakraborty
2023-05-12 14:14 ` [PATCH v2 5/6] dmaengine: pl330: Optimize AxSize for peripheral usecases Joy Chakraborty
2023-05-12 14:14 ` [PATCH v2 6/6] dmaengine: pl330: Use dma singles for peripheral _dregs 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=20230512141445.2026660-4-joychakr@google.com \
--to=joychakr@google.com \
--cc=danielmentz@google.com \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manugautam@google.com \
--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
all inboxes | Powered by JetHome®