mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +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:
+6
-10
@@ -776,10 +776,9 @@ static int tsc2007_open(FAR struct file *filep)
|
||||
uint8_t tmp;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct tsc2007_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@@ -829,10 +828,9 @@ static int tsc2007_close(FAR struct file *filep)
|
||||
FAR struct tsc2007_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct tsc2007_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@@ -872,10 +870,9 @@ static ssize_t tsc2007_read(FAR struct file *filep, FAR char *buffer,
|
||||
struct tsc2007_sample_s sample;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct tsc2007_dev_s *)inode->i_private;
|
||||
|
||||
/* Verify that the caller has provided a buffer large enough to receive
|
||||
@@ -1003,10 +1000,9 @@ static int tsc2007_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
int ret;
|
||||
|
||||
iinfo("cmd: %d arg: %ld\n", cmd, arg);
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct tsc2007_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@@ -1076,10 +1072,10 @@ static int tsc2007_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int i;
|
||||
|
||||
iinfo("setup: %d\n", (int)setup);
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct tsc2007_dev_s *)inode->i_private;
|
||||
|
||||
/* Are we setting up the poll? Or tearing it down? */
|
||||
|
||||
Reference in New Issue
Block a user