You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "patacongo (via GitHub)" <gi...@apache.org> on 2023/04/24 13:51:58 UTC
[GitHub] [nuttx] patacongo commented on a diff in pull request #9033: Fix the style issue in procfs
patacongo commented on code in PR #9033:
URL: https://github.com/apache/nuttx/pull/9033#discussion_r1175318178
##########
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_operations =
Review Comment:
I really dislike long variable names. However, they are often necessary if a variable has global scope. It is a good coding style to append something that forces the name into a "namespace" and prevents naming collisions.
I would suggest not simplifying the names like this. g_part_operation could very easily collide with some other variable naming in the future. I recommend extending the name with a "namespce" like `g_procfs_part_operation`.
I understand that that is a long cumbersome name but we will be happier in the long run if we try to prevent naming collisions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org