lib_pathbuffer:change ffs to ffsl

Summary:
  Avoid error
riscv-none-elf-ld: /github/workspace/sources/nuttx/staging/libc.a(lib_pathbuffer.o): in function `lib_get_pathbuffer':
/github/workspace/sources/nuttx/libs/libc/misc/lib_pathbuffer.c:89:(.text.lib_get_pathbuffer+0x1c): undefined reference to `ffs'
make[1]: *** [Makefile:189: nuttx] Error 1
make: *** [tools/Unix.mk:551: nuttx] Error 2

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
chenrun1
2024-11-09 22:03:14 +08:00
committed by Xiang Xiao
parent 50e89a54cb
commit 2b190de9d1
+3 -3
View File
@@ -41,8 +41,8 @@
struct pathbuffer_s
{
mutex_t lock; /* Lock for the buffer */
unsigned int free_bitmap; /* Bitmap of free buffer */
mutex_t lock; /* Lock for the buffer */
unsigned long free_bitmap; /* Bitmap of free buffer */
char buffer[CONFIG_LIBC_MAX_PATHBUFFER][PATH_MAX];
};
@@ -87,7 +87,7 @@ FAR char *lib_get_pathbuffer(void)
/* Try to find a free buffer */
nxmutex_lock(&g_pathbuffer.lock);
index = ffs(g_pathbuffer.free_bitmap) - 1;
index = ffsl(g_pathbuffer.free_bitmap) - 1;
if (index >= 0 && index < CONFIG_LIBC_MAX_PATHBUFFER)
{
g_pathbuffer.free_bitmap &= ~(1u << index);