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:
Xiang Xiao
2022-01-12 00:24:38 +08:00
committed by Petro Karashchenko
parent 10bb48b9b4
commit 1b77ae88ef
10 changed files with 0 additions and 158 deletions

View File

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