mirror of
https://github.com/apache/nuttx.git
synced 2025-12-12 13:55:18 +08:00
fs/procfs: Remove the unnecessary strcmp
since the procfs already make the same check for us Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
10bb48b9b4
commit
1b77ae88ef
@@ -218,14 +218,6 @@ static int meminfo_open(FAR struct file *filep, FAR const char *relpath,
|
||||
return -EACCES;
|
||||
}
|
||||
|
||||
/* "meminfo" is the only acceptable value for the relpath */
|
||||
|
||||
if (strcmp(relpath, "meminfo") != 0)
|
||||
{
|
||||
ferr("ERROR: relpath is '%s'\n", relpath);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/* Allocate a container to hold the file attributes */
|
||||
|
||||
procfile = (FAR struct meminfo_file_s *)
|
||||
@@ -439,14 +431,6 @@ static int meminfo_dup(FAR const struct file *oldp, FAR struct file *newp)
|
||||
|
||||
static int meminfo_stat(FAR const char *relpath, FAR struct stat *buf)
|
||||
{
|
||||
/* "meminfo" is the only acceptable value for the relpath */
|
||||
|
||||
if (strcmp(relpath, "meminfo") != 0)
|
||||
{
|
||||
ferr("ERROR: relpath is '%s'\n", relpath);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/* "meminfo" is the name for a read-only file */
|
||||
|
||||
memset(buf, 0, sizeof(struct stat));
|
||||
|
||||
Reference in New Issue
Block a user