This is an automated email from the ASF dual-hosted git repository. davids5 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit c6d210289f73bf646aa942dd1055960c66c9b127 Author: Xiang Xiao <[email protected]> AuthorDate: Tue Apr 18 02:27:33 2023 +0800 procfs: remove procfs_ from procfs_operations variables to aglin the naming style with other implementation Signed-off-by: Xiang Xiao <[email protected]> --- drivers/mtd/mtd_partition.c | 2 +- fs/mount/fs_procfs_mount.c | 2 +- fs/procfs/fs_procfs.c | 62 +++++++++++++++++++++---------------------- fs/smartfs/smartfs_procfs.c | 4 +-- net/procfs/net_procfs.c | 8 +++--- net/procfs/net_procfs_route.c | 2 +- 6 files changed, 40 insertions(+), 40 deletions(-) diff --git a/drivers/mtd/mtd_partition.c b/drivers/mtd/mtd_partition.c index 6bde2eec0c..b803b1fc4f 100644 --- a/drivers/mtd/mtd_partition.c +++ b/drivers/mtd/mtd_partition.c @@ -149,7 +149,7 @@ static int part_procfs_stat(FAR const char *relpath, #if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_PROCFS_EXCLUDE_PARTITIONS) static struct mtd_partition_s *g_pfirstpartition = NULL; -const struct procfs_operations g_part_procfsoperations = +const struct procfs_operations g_part_operations = { part_procfs_open, /* open */ part_procfs_close, /* close */ diff --git a/fs/mount/fs_procfs_mount.c b/fs/mount/fs_procfs_mount.c index 681b8c5cba..17275a0051 100644 --- a/fs/mount/fs_procfs_mount.c +++ b/fs/mount/fs_procfs_mount.c @@ -137,7 +137,7 @@ static int mount_stat(FAR const char *relpath, FAR struct stat *buf); * with any compiler. */ -const struct procfs_operations g_mount_procfsoperations = +const struct procfs_operations g_mount_operations = { mount_open, /* open */ mount_close, /* close */ diff --git a/fs/procfs/fs_procfs.c b/fs/procfs/fs_procfs.c index 0e167129cc..e0f0d849ee 100644 --- a/fs/procfs/fs_procfs.c +++ b/fs/procfs/fs_procfs.c @@ -72,11 +72,11 @@ extern const struct procfs_operations g_tcbinfo_operations; * configuration. */ -extern const struct procfs_operations g_net_procfsoperations; -extern const struct procfs_operations g_net_procfs_routeoperations; -extern const struct procfs_operations g_part_procfsoperations; -extern const struct procfs_operations g_mount_procfsoperations; -extern const struct procfs_operations g_smartfs_procfsoperations; +extern const struct procfs_operations g_net_operations; +extern const struct procfs_operations g_netroute_operations; +extern const struct procfs_operations g_part_operations; +extern const struct procfs_operations g_mount_operations; +extern const struct procfs_operations g_smartfs_operations; /**************************************************************************** * Private Types @@ -91,90 +91,90 @@ static const struct procfs_entry_s g_procfs_entries[] = #endif { #ifndef CONFIG_FS_PROCFS_EXCLUDE_PROCESS - { "[0-9]*/**", &g_proc_operations, PROCFS_UNKOWN_TYPE }, - { "[0-9]*", &g_proc_operations, PROCFS_DIR_TYPE }, + { "[0-9]*/**", &g_proc_operations, PROCFS_UNKOWN_TYPE }, + { "[0-9]*", &g_proc_operations, PROCFS_DIR_TYPE }, #endif #if defined(CONFIG_SCHED_CPULOAD) && !defined(CONFIG_FS_PROCFS_EXCLUDE_CPULOAD) - { "cpuload", &g_cpuload_operations, PROCFS_FILE_TYPE }, + { "cpuload", &g_cpuload_operations, PROCFS_FILE_TYPE }, #endif #ifdef CONFIG_SCHED_CRITMONITOR - { "critmon", &g_critmon_operations, PROCFS_FILE_TYPE }, + { "critmon", &g_critmon_operations, PROCFS_FILE_TYPE }, #endif #ifdef CONFIG_SCHED_IRQMONITOR - { "irqs", &g_irq_operations, PROCFS_FILE_TYPE }, + { "irqs", &g_irq_operations, PROCFS_FILE_TYPE }, #endif #ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMINFO - { "meminfo", &g_meminfo_operations, PROCFS_FILE_TYPE }, + { "meminfo", &g_meminfo_operations, PROCFS_FILE_TYPE }, # ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMDUMP - { "memdump", &g_memdump_operations, PROCFS_FILE_TYPE }, + { "memdump", &g_memdump_operations, PROCFS_FILE_TYPE }, # endif #endif #ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL - { "mempool", &g_mempool_operations, PROCFS_FILE_TYPE }, + { "mempool", &g_mempool_operations, PROCFS_FILE_TYPE }, #endif #if defined(CONFIG_MM_IOB) && !defined(CONFIG_FS_PROCFS_EXCLUDE_IOBINFO) - { "iobinfo", &g_iobinfo_operations, PROCFS_FILE_TYPE }, + { "iobinfo", &g_iobinfo_operations, PROCFS_FILE_TYPE }, #endif #if defined(CONFIG_MODULE) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MODULE) - { "modules", &g_module_operations, PROCFS_FILE_TYPE }, + { "modules", &g_module_operations, PROCFS_FILE_TYPE }, #endif #ifndef CONFIG_FS_PROCFS_EXCLUDE_BLOCKS - { "fs/blocks", &g_mount_procfsoperations, PROCFS_FILE_TYPE }, + { "fs/blocks", &g_mount_operations, PROCFS_FILE_TYPE }, #endif #ifndef CONFIG_FS_PROCFS_EXCLUDE_MOUNT - { "fs/mount", &g_mount_procfsoperations, PROCFS_FILE_TYPE }, + { "fs/mount", &g_mount_operations, PROCFS_FILE_TYPE }, #endif #ifndef CONFIG_FS_PROCFS_EXCLUDE_USAGE - { "fs/usage", &g_mount_procfsoperations, PROCFS_FILE_TYPE }, + { "fs/usage", &g_mount_operations, PROCFS_FILE_TYPE }, #endif #if defined(CONFIG_FS_SMARTFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_SMARTFS) - { "fs/smartfs**", &g_smartfs_procfsoperations, PROCFS_UNKOWN_TYPE }, + { "fs/smartfs**", &g_smartfs_operations, PROCFS_UNKOWN_TYPE }, #endif #if defined(CONFIG_NET) && !defined(CONFIG_FS_PROCFS_EXCLUDE_NET) - { "net", &g_net_procfsoperations, PROCFS_DIR_TYPE }, + { "net", &g_net_operations, PROCFS_DIR_TYPE }, # if defined(CONFIG_NET_ROUTE) && !defined(CONFIG_FS_PROCFS_EXCLUDE_ROUTE) - { "net/route", &g_net_procfs_routeoperations, PROCFS_DIR_TYPE }, - { "net/route/**", &g_net_procfs_routeoperations, PROCFS_UNKOWN_TYPE }, + { "net/route", &g_netroute_operations, PROCFS_DIR_TYPE }, + { "net/route/**", &g_netroute_operations, PROCFS_UNKOWN_TYPE }, # endif - { "net/**", &g_net_procfsoperations, PROCFS_UNKOWN_TYPE }, + { "net/**", &g_net_operations, PROCFS_UNKOWN_TYPE }, #endif #if defined(CONFIG_MTD_PARTITION) && !defined(CONFIG_FS_PROCFS_EXCLUDE_PARTITIONS) - { "partitions", &g_part_procfsoperations, PROCFS_FILE_TYPE }, + { "partitions", &g_part_operations, PROCFS_FILE_TYPE }, #endif #if defined(CONFIG_PM) && defined(CONFIG_PM_PROCFS) - { "pm", &g_pm_operations, PROCFS_DIR_TYPE }, - { "pm/**", &g_pm_operations, PROCFS_UNKOWN_TYPE }, + { "pm", &g_pm_operations, PROCFS_DIR_TYPE }, + { "pm/**", &g_pm_operations, PROCFS_UNKOWN_TYPE }, #endif #ifndef CONFIG_FS_PROCFS_EXCLUDE_PROCESS - { "self", &g_proc_operations, PROCFS_DIR_TYPE }, - { "self/**", &g_proc_operations, PROCFS_UNKOWN_TYPE }, + { "self", &g_proc_operations, PROCFS_DIR_TYPE }, + { "self/**", &g_proc_operations, PROCFS_UNKOWN_TYPE }, #endif #if !defined(CONFIG_FS_PROCFS_EXCLUDE_UPTIME) - { "uptime", &g_uptime_operations, PROCFS_FILE_TYPE }, + { "uptime", &g_uptime_operations, PROCFS_FILE_TYPE }, #endif #if !defined(CONFIG_FS_PROCFS_EXCLUDE_VERSION) - { "version", &g_version_operations, PROCFS_FILE_TYPE }, + { "version", &g_version_operations, PROCFS_FILE_TYPE }, #endif #if defined(CONFIG_DEBUG_TCBINFO) && !defined(CONFIG_FS_PROCFS_EXCLUDE_TCBINFO) - { "tcbinfo", &g_tcbinfo_operations, PROCFS_FILE_TYPE }, + { "tcbinfo", &g_tcbinfo_operations, PROCFS_FILE_TYPE }, #endif }; diff --git a/fs/smartfs/smartfs_procfs.c b/fs/smartfs/smartfs_procfs.c index abd590ca4c..156c2637b9 100644 --- a/fs/smartfs/smartfs_procfs.c +++ b/fs/smartfs/smartfs_procfs.c @@ -168,7 +168,7 @@ static const uint8_t g_direntrycount = sizeof(g_direntry) / * with any compiler. */ -const struct procfs_operations g_smartfs_procfsoperations = +const struct procfs_operations g_smartfs_operations = { smartfs_open, /* open */ smartfs_close, /* close */ @@ -348,7 +348,7 @@ static int smartfs_open(FAR struct file *filep, FAR const char *relpath, */ if (((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) && - (g_smartfs_procfsoperations.write == NULL)) + (g_smartfs_operations.write == NULL)) { ferr("ERROR: Only O_RDONLY supported\n"); return -EACCES; diff --git a/net/procfs/net_procfs.c b/net/procfs/net_procfs.c index 80b24bda52..a59a36b364 100644 --- a/net/procfs/net_procfs.c +++ b/net/procfs/net_procfs.c @@ -99,7 +99,7 @@ static int netprocfs_stat(FAR const char *relpath, FAR struct stat *buf); * Private Data ****************************************************************************/ -extern const struct procfs_operations g_net_procfs_routeoperations; +extern const struct procfs_operations g_netroute_operations; /* Netprocfs component mappings */ @@ -141,7 +141,7 @@ static const struct netprocfs_entry_s g_net_entries[] = { DTYPE_DIRECTORY, "route", { - (FAR void *)&g_net_procfs_routeoperations + (FAR void *)&g_netroute_operations } }, #endif @@ -162,7 +162,7 @@ static const struct netprocfs_entry_s g_net_entries[] = * with any compiler. */ -const struct procfs_operations g_net_procfsoperations = +const struct procfs_operations g_net_operations = { netprocfs_open, /* open */ netprocfs_close, /* close */ @@ -202,7 +202,7 @@ static int netprocfs_open(FAR struct file *filep, FAR const char *relpath, */ if (((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) && - (g_net_procfsoperations.write == NULL)) + (g_net_operations.write == NULL)) { ferr("ERROR: Only O_RDONLY supported\n"); return -EACCES; diff --git a/net/procfs/net_procfs_route.c b/net/procfs/net_procfs_route.c index 9d919368cd..f3384276f5 100644 --- a/net/procfs/net_procfs_route.c +++ b/net/procfs/net_procfs_route.c @@ -175,7 +175,7 @@ static int route_stat(FAR const char *relpath, FAR struct stat *buf); * with any compiler. */ -const struct procfs_operations g_net_procfs_routeoperations = +const struct procfs_operations g_netroute_operations = { route_open, /* open */ route_close, /* close */
