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:
parent
face32cd3c
commit
2f8d78ef64
2 changed files with 5 additions and 5 deletions
|
@ -129,7 +129,7 @@ config LIBC_PATHBUFFER
|
||||||
|
|
||||||
if LIBC_PATHBUFFER
|
if LIBC_PATHBUFFER
|
||||||
|
|
||||||
config LIBC_MAX_PATHBUFFER
|
config LIBC_PATHBUFFER_MAX
|
||||||
int "Maximum size of a temporary file path buffer array"
|
int "Maximum size of a temporary file path buffer array"
|
||||||
range 0 32
|
range 0 32
|
||||||
default 2
|
default 2
|
||||||
|
|
|
@ -43,7 +43,7 @@ struct pathbuffer_s
|
||||||
{
|
{
|
||||||
spinlock_t lock; /* Lock for the buffer */
|
spinlock_t lock; /* Lock for the buffer */
|
||||||
unsigned long free_bitmap; /* Bitmap of free 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 =
|
static struct pathbuffer_s g_pathbuffer =
|
||||||
{
|
{
|
||||||
SP_UNLOCKED,
|
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);
|
flags = spin_lock_irqsave(&g_pathbuffer.lock);
|
||||||
index = ffsl(g_pathbuffer.free_bitmap) - 1;
|
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);
|
g_pathbuffer.free_bitmap &= ~(1u << index);
|
||||||
spin_unlock_irqrestore(&g_pathbuffer.lock, flags);
|
spin_unlock_irqrestore(&g_pathbuffer.lock, flags);
|
||||||
|
@ -129,7 +129,7 @@ void lib_put_pathbuffer(FAR char *buffer)
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
index = (buffer - &g_pathbuffer.buffer[0][0]) / PATH_MAX;
|
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 */
|
/* Mark the corresponding bit as free */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue