From 4c379ecc98cb52a315237f574ca386410786a161 Mon Sep 17 00:00:00 2001 From: chao an Date: Tue, 10 Dec 2024 12:55:46 +0800 Subject: [PATCH] libs/libc: rename LIBC_MAX_PATHBUFFER to LIBC_PATHBUFFER_MAX Unified naming style: if LIBC_PATHBUFFER config LIBC_PATHBUFFER_MAX ... config LIBC_PATHBUFFER_MALLOC ... endif # LIBC_PATHBUFFER Signed-off-by: chao an --- libs/libc/misc/Kconfig | 2 +- libs/libc/misc/lib_pathbuffer.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/libc/misc/Kconfig b/libs/libc/misc/Kconfig index 44d66689d6..9af74f518f 100644 --- a/libs/libc/misc/Kconfig +++ b/libs/libc/misc/Kconfig @@ -129,7 +129,7 @@ config LIBC_PATHBUFFER if LIBC_PATHBUFFER -config LIBC_MAX_PATHBUFFER +config LIBC_PATHBUFFER_MAX int "Maximum size of a temporary file path buffer array" range 0 32 default 2 diff --git a/libs/libc/misc/lib_pathbuffer.c b/libs/libc/misc/lib_pathbuffer.c index 3928130dc8..c5af63bf89 100644 --- a/libs/libc/misc/lib_pathbuffer.c +++ b/libs/libc/misc/lib_pathbuffer.c @@ -43,7 +43,7 @@ struct pathbuffer_s { spinlock_t lock; /* Lock for the buffer */ unsigned long free_bitmap; /* Bitmap of free buffer */ - char buffer[CONFIG_LIBC_MAX_PATHBUFFER][PATH_MAX]; + char buffer[CONFIG_LIBC_PATHBUFFER_MAX][PATH_MAX]; }; /**************************************************************************** @@ -53,7 +53,7 @@ struct pathbuffer_s static struct pathbuffer_s g_pathbuffer = { SP_UNLOCKED, - (1u << CONFIG_LIBC_MAX_PATHBUFFER) - 1, + (1u << CONFIG_LIBC_PATHBUFFER_MAX) - 1, }; /**************************************************************************** @@ -89,7 +89,7 @@ FAR char *lib_get_pathbuffer(void) flags = spin_lock_irqsave(&g_pathbuffer.lock); index = ffsl(g_pathbuffer.free_bitmap) - 1; - if (index >= 0 && index < CONFIG_LIBC_MAX_PATHBUFFER) + if (index >= 0 && index < CONFIG_LIBC_PATHBUFFER_MAX) { g_pathbuffer.free_bitmap &= ~(1u << index); spin_unlock_irqrestore(&g_pathbuffer.lock, flags); @@ -129,7 +129,7 @@ void lib_put_pathbuffer(FAR char *buffer) int index; index = (buffer - &g_pathbuffer.buffer[0][0]) / PATH_MAX; - if (index >= 0 && index < CONFIG_LIBC_MAX_PATHBUFFER) + if (index >= 0 && index < CONFIG_LIBC_PATHBUFFER_MAX) { /* Mark the corresponding bit as free */