procfs: Add g_ prefix to all procfs_operations

to conform the coding style

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-04-18 02:23:18 +08:00 committed by David Sidrane
parent e6490694a1
commit 149cafe450
18 changed files with 66 additions and 66 deletions

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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
};

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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;

View File

@ -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 */

View File

@ -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;

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */