Skip to content

Commit

Permalink
rename lib_pathbuffer to lib_tempbuffer
Browse files Browse the repository at this point in the history
Signed-off-by: zhangshoukui <[email protected]>
  • Loading branch information
Zhangshoukui committed Dec 27, 2024
1 parent e19e1a8 commit e32c742
Show file tree
Hide file tree
Showing 43 changed files with 227 additions and 225 deletions.
6 changes: 3 additions & 3 deletions arch/risc-v/src/common/espressif/esp_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ int esp_timer_initialize(uint32_t timer_id)
break;
}

devpath = lib_get_pathbuffer();
devpath = lib_get_tempbuffer(PATH_MAX);
if (devpath == NULL)
{
return -ENOMEM;
Expand Down Expand Up @@ -571,11 +571,11 @@ int esp_timer_initialize(uint32_t timer_id)
* indicate the failure (implying the non-unique devpath).
*/

lib_put_pathbuffer(devpath);
lib_put_tempbuffer(devpath);
return -EEXIST;
}

lib_put_pathbuffer(devpath);
lib_put_tempbuffer(devpath);
esp_setup_irq(lower->source,
ESP_IRQ_PRIORITY_DEFAULT,
ESP_IRQ_TRIGGER_LEVEL);
Expand Down
4 changes: 2 additions & 2 deletions drivers/input/aw86225.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ static int aw86225_request_firmware(FAR struct aw86225_firmware *fw,
size_t file_size;
int ret;

file_path = lib_get_pathbuffer();
file_path = lib_get_tempbuffer(PATH_MAX);
if (file_path == NULL)
{
return -ENOMEM;
Expand All @@ -388,7 +388,7 @@ static int aw86225_request_firmware(FAR struct aw86225_firmware *fw,
snprintf(file_path, PATH_MAX, "%s/%s",
CONFIG_AW86225_RTP_FILE_PATH, filename);
ret = file_open(&file, file_path, O_RDONLY);
lib_put_pathbuffer(file_path);
lib_put_tempbuffer(file_path);
if (ret < 0)
{
ierr("open file failed");
Expand Down
4 changes: 2 additions & 2 deletions drivers/mtd/dhara.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ int dhara_initialize(int minor, FAR struct mtd_dev_s *mtd)
}
#endif

path = lib_get_pathbuffer();
path = lib_get_tempbuffer(PATH_MAX);
if (path == NULL)
{
return -ENOMEM;
Expand All @@ -808,6 +808,6 @@ int dhara_initialize(int minor, FAR struct mtd_dev_s *mtd)

snprintf(path, PATH_MAX, "/dev/mtdblock%d", minor);
ret = dhara_initialize_by_path(path, mtd);
lib_put_pathbuffer(path);
lib_put_tempbuffer(path);
return ret;
}
10 changes: 5 additions & 5 deletions drivers/sensors/gnss_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ int gnss_register(FAR struct gnss_lowerhalf_s *lower, int devno,
return -ENOMEM;
}

path = lib_get_pathbuffer();
path = lib_get_tempbuffer(PATH_MAX);
if (path == NULL)
{
kmm_free(upper);
Expand Down Expand Up @@ -822,7 +822,7 @@ int gnss_register(FAR struct gnss_lowerhalf_s *lower, int devno,
goto driver_err;
}

lib_put_pathbuffer(path);
lib_put_tempbuffer(path);
return ret;

driver_err:
Expand All @@ -843,7 +843,7 @@ int gnss_register(FAR struct gnss_lowerhalf_s *lower, int devno,
nxmutex_destroy(&upper->lock);
nxmutex_destroy(&upper->bufferlock);
nxsem_destroy(&upper->buffersem);
lib_put_pathbuffer(path);
lib_put_tempbuffer(path);
kmm_free(upper);
return ret;
}
Expand All @@ -868,7 +868,7 @@ void gnss_unregister(FAR struct gnss_lowerhalf_s *lower, int devno)
FAR struct gnss_upperhalf_s *upper = lower->priv;
FAR char *path;

path = lib_get_pathbuffer();
path = lib_get_tempbuffer(PATH_MAX);
if (path == NULL)
{
return;
Expand All @@ -885,6 +885,6 @@ void gnss_unregister(FAR struct gnss_lowerhalf_s *lower, int devno)
unregister_driver(path);
nxsem_destroy(&upper->buffersem);
circbuf_uninit(&upper->buffer);
lib_put_pathbuffer(path);
lib_put_tempbuffer(path);
kmm_free(upper);
}
8 changes: 4 additions & 4 deletions drivers/sensors/sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@ int sensor_register(FAR struct sensor_lowerhalf_s *lower, int devno)

DEBUGASSERT(lower != NULL);

path = lib_get_pathbuffer();
path = lib_get_tempbuffer(PATH_MAX);
if (path == NULL)
{
return -ENOMEM;
Expand All @@ -1259,7 +1259,7 @@ int sensor_register(FAR struct sensor_lowerhalf_s *lower, int devno)
devno);
ret = sensor_custom_register(lower, path,
g_sensor_meta[lower->type].esize);
lib_put_pathbuffer(path);
lib_put_tempbuffer(path);
return ret;
}

Expand Down Expand Up @@ -1395,7 +1395,7 @@ void sensor_unregister(FAR struct sensor_lowerhalf_s *lower, int devno)
{
FAR char *path;

path = lib_get_pathbuffer();
path = lib_get_tempbuffer(PATH_MAX);
if (path == NULL)
{
return;
Expand All @@ -1406,7 +1406,7 @@ void sensor_unregister(FAR struct sensor_lowerhalf_s *lower, int devno)
lower->uncalibrated ? DEVNAME_UNCAL : "",
devno);
sensor_custom_unregister(lower, path);
lib_put_pathbuffer(path);
lib_put_tempbuffer(path);
}

/****************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions fs/inode/fs_files.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ void files_dumplist(FAR struct filelist *list)
"PID", "FD", "FLAGS", "TYPE", "POS", "PATH"
);

path = lib_get_pathbuffer();
path = lib_get_tempbuffer(PATH_MAX);
if (path == NULL)
{
return;
Expand Down Expand Up @@ -451,7 +451,7 @@ void files_dumplist(FAR struct filelist *list)
fs_putfilep(filep);
}

lib_put_pathbuffer(path);
lib_put_tempbuffer(path);
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions fs/littlefs/lfs_vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ static int littlefs_mkdir(FAR struct inode *mountpt, FAR const char *relpath,

if (len > 0 && relpath[len - 1] == '/')
{
path = lib_get_pathbuffer();
path = lib_get_tempbuffer(PATH_MAX);
if (path == NULL)
{
return -ENOMEM;
Expand Down Expand Up @@ -1583,7 +1583,7 @@ static int littlefs_mkdir(FAR struct inode *mountpt, FAR const char *relpath,
errout:
if (path != relpath)
{
lib_put_pathbuffer(path);
lib_put_tempbuffer(path);
}

return ret;
Expand Down
10 changes: 5 additions & 5 deletions fs/mount/fs_automount.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ FAR void *automount_initialize(FAR const struct automount_lower_s *lower)
FAR struct automounter_state_s *priv;
int ret;
#ifdef CONFIG_FS_AUTOMOUNTER_DRIVER
FAR char *devpath = lib_get_pathbuffer();
FAR char *devpath = lib_get_tempbuffer(PATH_MAX);
if (devpath == NULL)
{
return NULL;
Expand All @@ -827,7 +827,7 @@ FAR void *automount_initialize(FAR const struct automount_lower_s *lower)
{
ferr("ERROR: Failed to allocate state structure\n");
#ifdef CONFIG_FS_AUTOMOUNTER_DRIVER
lib_put_pathbuffer(devpath);
lib_put_tempbuffer(devpath);
#endif /* CONFIG_FS_AUTOMOUNTER_DRIVER */
return NULL;
}
Expand Down Expand Up @@ -865,7 +865,7 @@ FAR void *automount_initialize(FAR const struct automount_lower_s *lower)
CONFIG_FS_AUTOMOUNTER_VFS_PATH "%s", lower->mountpoint);

ret = register_driver(devpath, &g_automount_fops, 0444, priv);
lib_put_pathbuffer(devpath);
lib_put_tempbuffer(devpath);
if (ret < 0)
{
ferr("ERROR: Failed to register automount driver: %d\n", ret);
Expand Down Expand Up @@ -922,7 +922,7 @@ void automount_uninitialize(FAR void *handle)
#ifdef CONFIG_FS_AUTOMOUNTER_DRIVER
if (priv->registered)
{
FAR char *devpath = lib_get_pathbuffer();
FAR char *devpath = lib_get_tempbuffer(PATH_MAX);
if (devpath == NULL)
{
return;
Expand All @@ -932,7 +932,7 @@ void automount_uninitialize(FAR void *handle)
CONFIG_FS_AUTOMOUNTER_VFS_PATH "%s", lower->mountpoint);

unregister_driver(devpath);
lib_put_pathbuffer(devpath);
lib_put_tempbuffer(devpath);
}

nxmutex_destroy(&priv->lock);
Expand Down
16 changes: 8 additions & 8 deletions fs/notify/inotify.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ static void notify_queue_path_event(FAR const char *path, uint32_t mask)
FAR char *pathbuffer;
uint32_t cookie = 0;

pathbuffer = lib_get_pathbuffer();
pathbuffer = lib_get_tempbuffer(PATH_MAX);
if (pathbuffer == NULL)
{
return;
Expand All @@ -890,7 +890,7 @@ static void notify_queue_path_event(FAR const char *path, uint32_t mask)
abspath = lib_realpath(path, pathbuffer, true);
if (abspath == NULL)
{
lib_put_pathbuffer(pathbuffer);
lib_put_tempbuffer(pathbuffer);
return;
}

Expand All @@ -906,7 +906,7 @@ static void notify_queue_path_event(FAR const char *path, uint32_t mask)

list = inotify_get_watch_list(abspath);
inotify_queue_parent_event(abspath, mask, cookie);
lib_put_pathbuffer(pathbuffer);
lib_put_tempbuffer(pathbuffer);
if (list == NULL)
{
return;
Expand Down Expand Up @@ -988,7 +988,7 @@ static inline void notify_queue_filep_event(FAR struct file *filep,
return;
}

pathbuffer = lib_get_pathbuffer();
pathbuffer = lib_get_tempbuffer(PATH_MAX);
if (pathbuffer == NULL)
{
return;
Expand All @@ -997,7 +997,7 @@ static inline void notify_queue_filep_event(FAR struct file *filep,
ret = file_fcntl(filep, F_GETPATH, pathbuffer);
if (ret < 0)
{
lib_put_pathbuffer(pathbuffer);
lib_put_tempbuffer(pathbuffer);
return;
}

Expand All @@ -1008,7 +1008,7 @@ static inline void notify_queue_filep_event(FAR struct file *filep,

nxmutex_lock(&g_inotify.lock);
notify_queue_path_event(pathbuffer, mask);
lib_put_pathbuffer(pathbuffer);
lib_put_tempbuffer(pathbuffer);
nxmutex_unlock(&g_inotify.lock);
}

Expand Down Expand Up @@ -1368,7 +1368,7 @@ void notify_close2(FAR struct inode *inode)
{
FAR char *pathbuffer;

pathbuffer = lib_get_pathbuffer();
pathbuffer = lib_get_tempbuffer(PATH_MAX);
if (pathbuffer == NULL)
{
return;
Expand All @@ -1380,7 +1380,7 @@ void notify_close2(FAR struct inode *inode)
notify_queue_path_event(pathbuffer, IN_CLOSE_WRITE);
}

lib_put_pathbuffer(pathbuffer);
lib_put_tempbuffer(pathbuffer);
nxmutex_unlock(&g_inotify.lock);
}

Expand Down
4 changes: 2 additions & 2 deletions fs/partition/fs_partition.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static void register_partition(FAR struct partition_s *part, FAR void *arg)
FAR struct partition_state_s *state = reg->state;
FAR char *path;

path = lib_get_pathbuffer();
path = lib_get_tempbuffer(PATH_MAX);
if (path == NULL)
{
return;
Expand All @@ -115,7 +115,7 @@ static void register_partition(FAR struct partition_s *part, FAR void *arg)
}
#endif

lib_put_pathbuffer(path);
lib_put_tempbuffer(path);
}
}

Expand Down
6 changes: 3 additions & 3 deletions fs/procfs/fs_procfsproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile,
return totalsize;
}

path = lib_get_pathbuffer();
path = lib_get_tempbuffer(PATH_MAX);
if (path == NULL)
{
return totalsize;
Expand Down Expand Up @@ -1343,12 +1343,12 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile,

if (totalsize >= buflen)
{
lib_put_pathbuffer(path);
lib_put_tempbuffer(path);
return totalsize;
}
}

lib_put_pathbuffer(path);
lib_put_tempbuffer(path);
return totalsize;
}

Expand Down
Loading

0 comments on commit e32c742

Please sign in to comment.