From 149cafe450a404b0befc81bcf56bc3c1dcb8fd8b Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 18 Apr 2023 02:23:18 +0800 Subject: [PATCH] procfs: Add g_ prefix to all procfs_operations to conform the coding style Signed-off-by: Xiang Xiao --- drivers/mtd/mtd_partition.c | 2 +- drivers/power/pm/pm_procfs.c | 2 +- fs/mount/fs_procfs_mount.c | 2 +- fs/procfs/fs_procfs.c | 88 +++++++++++++++++------------------ fs/procfs/fs_procfscpuload.c | 2 +- fs/procfs/fs_procfscritmon.c | 2 +- fs/procfs/fs_procfsiobinfo.c | 2 +- fs/procfs/fs_procfsmeminfo.c | 4 +- fs/procfs/fs_procfsproc.c | 2 +- fs/procfs/fs_procfstcbinfo.c | 2 +- fs/procfs/fs_procfsuptime.c | 2 +- fs/procfs/fs_procfsversion.c | 2 +- fs/smartfs/smartfs_procfs.c | 4 +- mm/mempool/mempool_procfs.c | 2 +- net/procfs/net_procfs.c | 8 ++-- net/procfs/net_procfs_route.c | 2 +- sched/irq/irq_procfs.c | 2 +- sched/module/mod_procfs.c | 2 +- 18 files changed, 66 insertions(+), 66 deletions(-) diff --git a/drivers/mtd/mtd_partition.c b/drivers/mtd/mtd_partition.c index 0b0f8db7f3..6bde2eec0c 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 part_procfsoperations = +const struct procfs_operations g_part_procfsoperations = { part_procfs_open, /* open */ part_procfs_close, /* close */ diff --git a/drivers/power/pm/pm_procfs.c b/drivers/power/pm/pm_procfs.c index 83b1a90a78..69a09c459c 100644 --- a/drivers/power/pm/pm_procfs.c +++ b/drivers/power/pm/pm_procfs.c @@ -123,7 +123,7 @@ static int pm_stat(FAR const char *relpath, FAR struct stat *buf); * with any compiler. */ -const struct procfs_operations pm_operations = +const struct procfs_operations g_pm_operations = { pm_open, /* open */ pm_close, /* close */ diff --git a/fs/mount/fs_procfs_mount.c b/fs/mount/fs_procfs_mount.c index aeaf74b0dd..681b8c5cba 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 mount_procfsoperations = +const struct procfs_operations g_mount_procfsoperations = { mount_open, /* open */ mount_close, /* close */ diff --git a/fs/procfs/fs_procfs.c b/fs/procfs/fs_procfs.c index d2fb4eeba5..0e167129cc 100644 --- a/fs/procfs/fs_procfs.c +++ b/fs/procfs/fs_procfs.c @@ -52,19 +52,19 @@ * External Definitions ****************************************************************************/ -extern const struct procfs_operations proc_operations; -extern const struct procfs_operations pm_operations; -extern const struct procfs_operations irq_operations; -extern const struct procfs_operations cpuload_operations; -extern const struct procfs_operations critmon_operations; -extern const struct procfs_operations meminfo_operations; -extern const struct procfs_operations memdump_operations; -extern const struct procfs_operations mempool_operations; -extern const struct procfs_operations iobinfo_operations; -extern const struct procfs_operations module_operations; -extern const struct procfs_operations uptime_operations; -extern const struct procfs_operations version_operations; -extern const struct procfs_operations tcbinfo_operations; +extern const struct procfs_operations g_proc_operations; +extern const struct procfs_operations g_pm_operations; +extern const struct procfs_operations g_irq_operations; +extern const struct procfs_operations g_cpuload_operations; +extern const struct procfs_operations g_critmon_operations; +extern const struct procfs_operations g_meminfo_operations; +extern const struct procfs_operations g_memdump_operations; +extern const struct procfs_operations g_mempool_operations; +extern const struct procfs_operations g_iobinfo_operations; +extern const struct procfs_operations g_module_operations; +extern const struct procfs_operations g_uptime_operations; +extern const struct procfs_operations g_version_operations; +extern const struct procfs_operations g_tcbinfo_operations; /* This is not good. These are implemented in other sub-systems. Having to * deal with them here is not a good coupling. What is really needed is a @@ -72,11 +72,11 @@ extern const struct procfs_operations tcbinfo_operations; * configuration. */ -extern const struct procfs_operations net_procfsoperations; -extern const struct procfs_operations net_procfs_routeoperations; -extern const struct procfs_operations part_procfsoperations; -extern const struct procfs_operations mount_procfsoperations; -extern const struct procfs_operations smartfs_procfsoperations; +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; /**************************************************************************** * Private Types @@ -91,90 +91,90 @@ static const struct procfs_entry_s g_procfs_entries[] = #endif { #ifndef CONFIG_FS_PROCFS_EXCLUDE_PROCESS - { "[0-9]*/**", &proc_operations, PROCFS_UNKOWN_TYPE }, - { "[0-9]*", &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", &cpuload_operations, PROCFS_FILE_TYPE }, + { "cpuload", &g_cpuload_operations, PROCFS_FILE_TYPE }, #endif #ifdef CONFIG_SCHED_CRITMONITOR - { "critmon", &critmon_operations, PROCFS_FILE_TYPE }, + { "critmon", &g_critmon_operations, PROCFS_FILE_TYPE }, #endif #ifdef CONFIG_SCHED_IRQMONITOR - { "irqs", &irq_operations, PROCFS_FILE_TYPE }, + { "irqs", &g_irq_operations, PROCFS_FILE_TYPE }, #endif #ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMINFO - { "meminfo", &meminfo_operations, PROCFS_FILE_TYPE }, + { "meminfo", &g_meminfo_operations, PROCFS_FILE_TYPE }, # ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMDUMP - { "memdump", &memdump_operations, PROCFS_FILE_TYPE }, + { "memdump", &g_memdump_operations, PROCFS_FILE_TYPE }, # endif #endif #ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL - { "mempool", &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", &iobinfo_operations, PROCFS_FILE_TYPE }, + { "iobinfo", &g_iobinfo_operations, PROCFS_FILE_TYPE }, #endif #if defined(CONFIG_MODULE) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MODULE) - { "modules", &module_operations, PROCFS_FILE_TYPE }, + { "modules", &g_module_operations, PROCFS_FILE_TYPE }, #endif #ifndef CONFIG_FS_PROCFS_EXCLUDE_BLOCKS - { "fs/blocks", &mount_procfsoperations, PROCFS_FILE_TYPE }, + { "fs/blocks", &g_mount_procfsoperations, PROCFS_FILE_TYPE }, #endif #ifndef CONFIG_FS_PROCFS_EXCLUDE_MOUNT - { "fs/mount", &mount_procfsoperations, PROCFS_FILE_TYPE }, + { "fs/mount", &g_mount_procfsoperations, PROCFS_FILE_TYPE }, #endif #ifndef CONFIG_FS_PROCFS_EXCLUDE_USAGE - { "fs/usage", &mount_procfsoperations, PROCFS_FILE_TYPE }, + { "fs/usage", &g_mount_procfsoperations, PROCFS_FILE_TYPE }, #endif #if defined(CONFIG_FS_SMARTFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_SMARTFS) - { "fs/smartfs**", &smartfs_procfsoperations, PROCFS_UNKOWN_TYPE }, + { "fs/smartfs**", &g_smartfs_procfsoperations, PROCFS_UNKOWN_TYPE }, #endif #if defined(CONFIG_NET) && !defined(CONFIG_FS_PROCFS_EXCLUDE_NET) - { "net", &net_procfsoperations, PROCFS_DIR_TYPE }, + { "net", &g_net_procfsoperations, PROCFS_DIR_TYPE }, # if defined(CONFIG_NET_ROUTE) && !defined(CONFIG_FS_PROCFS_EXCLUDE_ROUTE) - { "net/route", &net_procfs_routeoperations, PROCFS_DIR_TYPE }, - { "net/route/**", &net_procfs_routeoperations, PROCFS_UNKOWN_TYPE }, + { "net/route", &g_net_procfs_routeoperations, PROCFS_DIR_TYPE }, + { "net/route/**", &g_net_procfs_routeoperations, PROCFS_UNKOWN_TYPE }, # endif - { "net/**", &net_procfsoperations, PROCFS_UNKOWN_TYPE }, + { "net/**", &g_net_procfsoperations, PROCFS_UNKOWN_TYPE }, #endif #if defined(CONFIG_MTD_PARTITION) && !defined(CONFIG_FS_PROCFS_EXCLUDE_PARTITIONS) - { "partitions", &part_procfsoperations, PROCFS_FILE_TYPE }, + { "partitions", &g_part_procfsoperations, PROCFS_FILE_TYPE }, #endif #if defined(CONFIG_PM) && defined(CONFIG_PM_PROCFS) - { "pm", &pm_operations, PROCFS_DIR_TYPE }, - { "pm/**", &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", &proc_operations, PROCFS_DIR_TYPE }, - { "self/**", &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", &uptime_operations, PROCFS_FILE_TYPE }, + { "uptime", &g_uptime_operations, PROCFS_FILE_TYPE }, #endif #if !defined(CONFIG_FS_PROCFS_EXCLUDE_VERSION) - { "version", &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", &tcbinfo_operations, PROCFS_FILE_TYPE }, + { "tcbinfo", &g_tcbinfo_operations, PROCFS_FILE_TYPE }, #endif }; diff --git a/fs/procfs/fs_procfscpuload.c b/fs/procfs/fs_procfscpuload.c index 39376e0bc4..eafc7d576f 100644 --- a/fs/procfs/fs_procfscpuload.c +++ b/fs/procfs/fs_procfscpuload.c @@ -94,7 +94,7 @@ static int cpuload_stat(FAR const char *relpath, FAR struct stat *buf); * with any compiler. */ -const struct procfs_operations cpuload_operations = +const struct procfs_operations g_cpuload_operations = { cpuload_open, /* open */ cpuload_close, /* close */ diff --git a/fs/procfs/fs_procfscritmon.c b/fs/procfs/fs_procfscritmon.c index 1bfca09f80..427e0b8df9 100644 --- a/fs/procfs/fs_procfscritmon.c +++ b/fs/procfs/fs_procfscritmon.c @@ -93,7 +93,7 @@ static int critmon_stat(FAR const char *relpath, FAR struct stat *buf); * with any compiler. */ -const struct procfs_operations critmon_operations = +const struct procfs_operations g_critmon_operations = { critmon_open, /* open */ critmon_close, /* close */ diff --git a/fs/procfs/fs_procfsiobinfo.c b/fs/procfs/fs_procfsiobinfo.c index 4b13043175..f2c5cf694b 100644 --- a/fs/procfs/fs_procfsiobinfo.c +++ b/fs/procfs/fs_procfsiobinfo.c @@ -92,7 +92,7 @@ static int iobinfo_stat(FAR const char *relpath, FAR struct stat *buf); * with any compiler. */ -const struct procfs_operations iobinfo_operations = +const struct procfs_operations g_iobinfo_operations = { iobinfo_open, /* open */ iobinfo_close, /* close */ diff --git a/fs/procfs/fs_procfsmeminfo.c b/fs/procfs/fs_procfsmeminfo.c index a770357595..924bea2abe 100644 --- a/fs/procfs/fs_procfsmeminfo.c +++ b/fs/procfs/fs_procfsmeminfo.c @@ -117,7 +117,7 @@ static int meminfo_stat(FAR const char *relpath, FAR struct stat *buf); * with any compiler. */ -const struct procfs_operations meminfo_operations = +const struct procfs_operations g_meminfo_operations = { meminfo_open, /* open */ meminfo_close, /* close */ @@ -132,7 +132,7 @@ const struct procfs_operations meminfo_operations = }; #ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMDUMP -const struct procfs_operations memdump_operations = +const struct procfs_operations g_memdump_operations = { meminfo_open, /* open */ meminfo_close, /* close */ diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c index 61531ac8e6..39d3f76702 100644 --- a/fs/procfs/fs_procfsproc.c +++ b/fs/procfs/fs_procfsproc.c @@ -244,7 +244,7 @@ static int proc_stat(FAR const char *relpath, FAR struct stat *buf); * with any compiler. */ -const struct procfs_operations proc_operations = +const struct procfs_operations g_proc_operations = { proc_open, /* open */ proc_close, /* close */ diff --git a/fs/procfs/fs_procfstcbinfo.c b/fs/procfs/fs_procfstcbinfo.c index 3e70f955a6..ce65726e60 100644 --- a/fs/procfs/fs_procfstcbinfo.c +++ b/fs/procfs/fs_procfstcbinfo.c @@ -92,7 +92,7 @@ static int tcbinfo_stat(FAR const char *relpath, FAR struct stat *buf); * with any compiler. */ -const struct procfs_operations tcbinfo_operations = +const struct procfs_operations g_tcbinfo_operations = { tcbinfo_open, /* open */ tcbinfo_close, /* close */ diff --git a/fs/procfs/fs_procfsuptime.c b/fs/procfs/fs_procfsuptime.c index 0340fe24f0..1425cd498f 100644 --- a/fs/procfs/fs_procfsuptime.c +++ b/fs/procfs/fs_procfsuptime.c @@ -95,7 +95,7 @@ static int uptime_stat(FAR const char *relpath, FAR struct stat *buf); * with any compiler. */ -const struct procfs_operations uptime_operations = +const struct procfs_operations g_uptime_operations = { uptime_open, /* open */ uptime_close, /* close */ diff --git a/fs/procfs/fs_procfsversion.c b/fs/procfs/fs_procfsversion.c index b417af147f..5832da50ed 100644 --- a/fs/procfs/fs_procfsversion.c +++ b/fs/procfs/fs_procfsversion.c @@ -95,7 +95,7 @@ static int version_stat(FAR const char *relpath, FAR struct stat *buf); * with any compiler. */ -const struct procfs_operations version_operations = +const struct procfs_operations g_version_operations = { version_open, /* open */ version_close, /* close */ diff --git a/fs/smartfs/smartfs_procfs.c b/fs/smartfs/smartfs_procfs.c index 293baaebc1..abd590ca4c 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 smartfs_procfsoperations = +const struct procfs_operations g_smartfs_procfsoperations = { 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) && - (smartfs_procfsoperations.write == NULL)) + (g_smartfs_procfsoperations.write == NULL)) { ferr("ERROR: Only O_RDONLY supported\n"); return -EACCES; diff --git a/mm/mempool/mempool_procfs.c b/mm/mempool/mempool_procfs.c index c1304f3735..0cb99742ed 100644 --- a/mm/mempool/mempool_procfs.c +++ b/mm/mempool/mempool_procfs.c @@ -72,7 +72,7 @@ static ssize_t mempool_read(FAR struct file *filep, FAR char *buffer, * Public Data ****************************************************************************/ -const struct procfs_operations mempool_operations = +const struct procfs_operations g_mempool_operations = { mempool_open, /* open */ mempool_close, /* close */ diff --git a/net/procfs/net_procfs.c b/net/procfs/net_procfs.c index 837f7ff100..80b24bda52 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 net_procfs_routeoperations; +extern const struct procfs_operations g_net_procfs_routeoperations; /* Netprocfs component mappings */ @@ -141,7 +141,7 @@ static const struct netprocfs_entry_s g_net_entries[] = { DTYPE_DIRECTORY, "route", { - (FAR void *)&net_procfs_routeoperations + (FAR void *)&g_net_procfs_routeoperations } }, #endif @@ -162,7 +162,7 @@ static const struct netprocfs_entry_s g_net_entries[] = * with any compiler. */ -const struct procfs_operations net_procfsoperations = +const struct procfs_operations g_net_procfsoperations = { 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) && - (net_procfsoperations.write == NULL)) + (g_net_procfsoperations.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 9b6dcc1068..9d919368cd 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 net_procfs_routeoperations = +const struct procfs_operations g_net_procfs_routeoperations = { route_open, /* open */ route_close, /* close */ diff --git a/sched/irq/irq_procfs.c b/sched/irq/irq_procfs.c index ead5965aa0..221b6018ca 100644 --- a/sched/irq/irq_procfs.c +++ b/sched/irq/irq_procfs.c @@ -113,7 +113,7 @@ static int irq_stat(FAR const char *relpath, FAR struct stat *buf); * with any compiler. */ -const struct procfs_operations irq_operations = +const struct procfs_operations g_irq_operations = { irq_open, /* open */ irq_close, /* close */ diff --git a/sched/module/mod_procfs.c b/sched/module/mod_procfs.c index 1a8b50fc99..299af8e40d 100644 --- a/sched/module/mod_procfs.c +++ b/sched/module/mod_procfs.c @@ -100,7 +100,7 @@ static int modprocfs_stat(FAR const char *relpath, FAR struct stat *buf); * with any compiler. */ -const struct procfs_operations module_operations = +const struct procfs_operations g_module_operations = { modprocfs_open, /* open */ modprocfs_close, /* close */