fs/inode: remove all unnecessary check for filep/inode

Since VFS layer already contains sanity checks, so remove unnecessary lower half checks

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an
2023-08-28 17:17:05 +08:00
committed by Xiang Xiao
parent baabf4bbf3
commit 7aa45305b7
158 changed files with 412 additions and 714 deletions
+4 -4
View File
@@ -460,7 +460,7 @@ static ssize_t ramlog_file_read(FAR struct file *filep, FAR char *buffer,
/* Some sanity checking */
DEBUGASSERT(inode && inode->i_private);
DEBUGASSERT(inode->i_private);
priv = (FAR struct ramlog_dev_s *)inode->i_private;
/* If the circular buffer is empty, then wait for something to be written
@@ -622,7 +622,7 @@ static ssize_t ramlog_file_write(FAR struct file *filep,
/* Some sanity checking */
DEBUGASSERT(inode && inode->i_private);
DEBUGASSERT(inode->i_private);
priv = (FAR struct ramlog_dev_s *)inode->i_private;
return ramlog_addbuf(priv, buffer, len);
@@ -639,7 +639,7 @@ static int ramlog_file_ioctl(FAR struct file *filep, int cmd,
FAR struct ramlog_dev_s *priv;
int ret;
DEBUGASSERT(inode && inode->i_private);
DEBUGASSERT(inode->i_private);
priv = (FAR struct ramlog_dev_s *)inode->i_private;
ret = nxmutex_lock(&priv->rl_lock);
@@ -679,7 +679,7 @@ static int ramlog_file_poll(FAR struct file *filep, FAR struct pollfd *fds,
/* Some sanity checking */
DEBUGASSERT(inode && inode->i_private);
DEBUGASSERT(inode->i_private);
priv = (FAR struct ramlog_dev_s *)inode->i_private;
/* Get exclusive access to the poll structures */
+1 -1
View File
@@ -304,7 +304,7 @@ static ssize_t syslog_rpmsg_file_read(FAR struct file *filep,
/* Some sanity checking */
DEBUGASSERT(inode && inode->i_private);
DEBUGASSERT(inode->i_private);
priv = (FAR struct syslog_rpmsg_s *)inode->i_private;
flags = enter_critical_section();