mirror of
https://github.com/apache/nuttx.git
synced 2025-12-13 23:17:11 +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
@@ -136,14 +136,6 @@ static int tcbinfo_open(FAR struct file *filep, FAR const char *relpath,
|
||||
return -EACCES;
|
||||
}
|
||||
|
||||
/* "tcbinfo" is the only acceptable value for the relpath */
|
||||
|
||||
if (strcmp(relpath, "tcbinfo") != 0)
|
||||
{
|
||||
ferr("ERROR: relpath is '%s'\n", relpath);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/* Allocate a container to hold the file attributes */
|
||||
|
||||
attr = (FAR struct tcbinfo_file_s *)
|
||||
@@ -274,14 +266,6 @@ static int tcbinfo_dup(FAR const struct file *oldp, FAR struct file *newp)
|
||||
|
||||
static int tcbinfo_stat(FAR const char *relpath, FAR struct stat *buf)
|
||||
{
|
||||
/* "tcbinfo" is the only acceptable value for the relpath */
|
||||
|
||||
if (strcmp(relpath, "tcbinfo") != 0)
|
||||
{
|
||||
ferr("ERROR: relpath is '%s'\n", relpath);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/* "tcbinfo" is the name for a read-only file */
|
||||
|
||||
memset(buf, 0, sizeof(struct stat));
|
||||
|
||||
Reference in New Issue
Block a user