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 <anchao@lixiang.com>
This commit is contained in:
chao an 2024-12-10 12:55:46 +08:00 committed by Xiang Xiao
parent cf060b6bf2
commit 4c379ecc98
2 changed files with 5 additions and 5 deletions

View file

@ -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

View file

@ -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 */