[PATCH] dma: cosmetic: clean fsl_dma.c errors and code style
Chris Strong
csstrong at proton.me
Sat Oct 1 09:34:53 CEST 2022
Cleanup of the fsl_dma.c checkpatch immediate errors, whitespace
warnings and coding style.
Signed-off-by: Chris Strong <csstrong at proton.me>
---
drivers/dma/fsl_dma.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/dma/fsl_dma.c b/drivers/dma/fsl_dma.c
index 1864b5d88b..b0448e8b56 100644
--- a/drivers/dma/fsl_dma.c
+++ b/drivers/dma/fsl_dma.c
@@ -22,7 +22,6 @@
#define FSL_DMA_MR_DEFAULT (FSL_DMA_MR_BWC_DIS | FSL_DMA_MR_CTM_DIRECT)
#endif
-
#if defined(CONFIG_MPC83xx)
dma83xx_t *dma_base = (void *)(CONFIG_SYS_MPC83xx_DMA_ADDR);
#elif defined(CONFIG_MPC85xx)
@@ -42,7 +41,7 @@ static void dma_sync(void)
#endif
}
-static void out_dma32(volatile unsigned *addr, int val)
+static void out_dma32(volatile unsigned int *addr, int val)
{
#if defined(CONFIG_MPC83xx)
out_le32(addr, val);
@@ -51,7 +50,7 @@ static void out_dma32(volatile unsigned *addr, int val)
#endif
}
-static uint in_dma32(volatile unsigned *addr)
+static uint in_dma32(volatile unsigned int *addr)
{
#if defined(CONFIG_MPC83xx)
return in_le32(addr);
@@ -60,7 +59,8 @@ static uint in_dma32(volatile unsigned *addr)
#endif
}
-static uint dma_check(void) {
+static uint dma_check(void)
+{
volatile fsl_dma_t *dma = &dma_base->dma[0];
uint status;
@@ -74,13 +74,14 @@ static uint dma_check(void) {
dma_sync();
if (status != 0)
- printf ("DMA Error: status = %x\n", status);
+ printf("DMA Error: status = %x\n", status);
return status;
}
#if !defined(CONFIG_MPC83xx)
-void dma_init(void) {
+void dma_init(void)
+{
volatile fsl_dma_t *dma = &dma_base->dma[0];
out_dma32(&dma->satr, FSL_DMA_SATR_SREAD_SNOOP);
@@ -90,15 +91,16 @@ void dma_init(void) {
}
#endif
-int dmacpy(phys_addr_t dest, phys_addr_t src, phys_size_t count) {
+int dmacpy(phys_addr_t dest, phys_addr_t src, phys_size_t count)
+{
volatile fsl_dma_t *dma = &dma_base->dma[0];
uint xfer_size;
while (count) {
xfer_size = min(FSL_DMA_MAX_SIZE, count);
- out_dma32(&dma->dar, (u32) (dest & 0xFFFFFFFF));
- out_dma32(&dma->sar, (u32) (src & 0xFFFFFFFF));
+ out_dma32(&dma->dar, (u32)(dest & 0xFFFFFFFF));
+ out_dma32(&dma->sar, (u32)(src & 0xFFFFFFFF));
#if !defined(CONFIG_MPC83xx)
out_dma32(&dma->satr,
in_dma32(&dma->satr) | (u32)((u64)src >> 32));
--
2.34.1
More information about the U-Boot
mailing list