From 79188c6f3c34524fe75d88d5ee642be21374f8f9 Mon Sep 17 00:00:00 2001 From: Tim Fischer Date: Wed, 29 May 2024 12:07:24 +0200 Subject: [PATCH] lint: C sources --- sw/snRuntime/src/dma.h | 8 ++++++-- sw/tests/dma_mchan.c | 14 ++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/sw/snRuntime/src/dma.h b/sw/snRuntime/src/dma.h index 5d2db5b259..af75c0189e 100644 --- a/sw/snRuntime/src/dma.h +++ b/sw/snRuntime/src/dma.h @@ -236,7 +236,9 @@ inline void snrt_dma_wait_all_channel(uint32_t channel) { "1: \n" "dmstat %[tmp], %[cfg] \n" "bne %[tmp], zero, 1b \n" - : [ tmp ] "=&r"(tmp) : [ cfg ] "r"(cfg) :"t0"); + : [ tmp ] "=&r"(tmp) + : [ cfg ] "r"(cfg) + : "t0"); } /// Wait until all channels are idle @@ -249,7 +251,9 @@ inline void snrt_dma_wait_all_channels(uint32_t num_channels) { "1: \n" "dmstat %[tmp], %[cfg] \n" "bne %[tmp], zero, 1b \n" - : [ tmp ] "=&r"(tmp) : [ cfg ] "r"(cfg) :"t0"); + : [ tmp ] "=&r"(tmp) + : [ cfg ] "r"(cfg) + : "t0"); } } diff --git a/sw/tests/dma_mchan.c b/sw/tests/dma_mchan.c index f160c2ef3b..7e6dbec846 100644 --- a/sw/tests/dma_mchan.c +++ b/sw/tests/dma_mchan.c @@ -28,8 +28,8 @@ int main() { } // Start slow 2D transfer from L3 to L1 on channel 0. - snrt_dma_start_2d_channel(buffer_dst_l1_1, buffer_src_l3, TRANSFER_SIZE, - 0, TRANSFER_SIZE, TRANSFER_REP, 0); + snrt_dma_start_2d_channel(buffer_dst_l1_1, buffer_src_l3, TRANSFER_SIZE, 0, + TRANSFER_SIZE, TRANSFER_REP, 0); // Start fast 2D transfer from L1 to L1 on channel 1. snrt_dma_start_1d_channel(buffer_dst_l1_2, buffer_src_l1, TRANSFER_SIZE, 1); @@ -37,11 +37,12 @@ int main() { // Check that the fast transfer can finish first. uint32_t busy_slow, busy_fast; do { - asm volatile ("dmstati %0, 2" : "=r"(busy_slow)); - asm volatile ("dmstati %0, 6" : "=r"(busy_fast)); + asm volatile("dmstati %0, 2" : "=r"(busy_slow)); + asm volatile("dmstati %0, 6" : "=r"(busy_fast)); } while (busy_fast); - // Check that the fast transfer has finished and the slow transfer is still busy. + // Check that the fast transfer has finished and the slow transfer is still + // busy. if (!busy_slow) { errors++; } @@ -51,7 +52,8 @@ int main() { // Check that the main memory buffer contains the correct data. for (uint32_t i = 0; i < TRANSFER_LEN; i++) { - errors += (buffer_dst_l1_1[i] != TRANSFER_LEN * (TRANSFER_REP - 1) + i + 1); + errors += + (buffer_dst_l1_1[i] != TRANSFER_LEN * (TRANSFER_REP - 1) + i + 1); errors += (buffer_dst_l1_2[i] != 0xAAAAAAAA); }