From 04158445ef701ab495c59cce726791ed8ecdc14c Mon Sep 17 00:00:00 2001 From: Yucai Liu Date: Mon, 13 Oct 2025 09:56:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E5=B7=A5=E4=BD=9C=E6=B5=81=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E6=AD=A3=E7=A1=AE=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/fal/src/fal_flash.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/fal/src/fal_flash.c b/components/fal/src/fal_flash.c index d4fba4e3420..40c3176fc4f 100644 --- a/components/fal/src/fal_flash.c +++ b/components/fal/src/fal_flash.c @@ -33,12 +33,11 @@ static rt_uint8_t init_ok = 0; * * @return result */ -int fal_flash_init(void) +int fal_flash_init(void) { - rt_size_t i, j, offset; + rt_size_t i, j, offset; - if (init_ok) - { + if (init_ok){ return 0; } From 7d470b8df139b3a28314c8fc83c2394266008be1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 13 Oct 2025 02:17:20 +0000 Subject: [PATCH 2/2] style: format code with clang-format [skip ci] --- components/fal/src/fal_flash.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/components/fal/src/fal_flash.c b/components/fal/src/fal_flash.c index 40c3176fc4f..c87a55b4f0d 100644 --- a/components/fal/src/fal_flash.c +++ b/components/fal/src/fal_flash.c @@ -33,11 +33,12 @@ static rt_uint8_t init_ok = 0; * * @return result */ -int fal_flash_init(void) +int fal_flash_init(void) { - rt_size_t i, j, offset; + rt_size_t i, j, offset; - if (init_ok){ + if (init_ok) + { return 0; } @@ -52,25 +53,25 @@ int fal_flash_init(void) device_table[i]->ops.init(); } LOG_D("Flash device | %*.*s | addr: 0x%08lx | len: 0x%08x | blk_size: 0x%08x |initialized finish.", - FAL_DEV_NAME_MAX, FAL_DEV_NAME_MAX, device_table[i]->name, device_table[i]->addr, device_table[i]->len, - device_table[i]->blk_size); + FAL_DEV_NAME_MAX, FAL_DEV_NAME_MAX, device_table[i]->name, device_table[i]->addr, device_table[i]->len, + device_table[i]->blk_size); offset = 0; - for (j = 0; j < FAL_DEV_BLK_MAX; j ++) + for (j = 0; j < FAL_DEV_BLK_MAX; j++) { const struct flash_blk *blk = &device_table[i]->blocks[j]; rt_size_t blk_len = blk->count * blk->size; if (blk->count == 0 || blk->size == 0) break; - if(offset > device_table[i]->len) + if (offset > device_table[i]->len) { LOG_I("Flash device %*.*s: add block failed, offset %d > len %d.", - FAL_DEV_NAME_MAX, FAL_DEV_NAME_MAX, device_table[i]->name, device_table[i]->addr, offset, device_table[i]->len); + FAL_DEV_NAME_MAX, FAL_DEV_NAME_MAX, device_table[i]->name, device_table[i]->addr, offset, device_table[i]->len); break; } LOG_D(" blk%2d | addr: 0x%08lx | len: 0x%08x | blk_size: 0x%08x |initialized finish.", - j, device_table[i]->addr + offset, blk_len, blk->size); + j, device_table[i]->addr + offset, blk_len, blk->size); offset += blk_len; } } @@ -96,7 +97,8 @@ const struct fal_flash_dev *fal_flash_device_find(const char *name) for (i = 0; i < device_table_len; i++) { - if (!strncmp(name, device_table[i]->name, FAL_DEV_NAME_MAX)) { + if (!strncmp(name, device_table[i]->name, FAL_DEV_NAME_MAX)) + { return device_table[i]; } }