mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
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:
@@ -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 */
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user