fix:3.1代码检视

Signed-off-by: x_xiny <1301913191@qq.com>
Change-Id: I0e0b59cdc22b292ccf0a790010c037d43793a934
This commit is contained in:
x_xiny 2022-03-19 20:22:59 +08:00
parent 41b80ad20a
commit 5b87a530f5
20 changed files with 156 additions and 76 deletions

View File

@ -45,8 +45,6 @@
#include "bcache.h"
#endif
#include "pthread.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {

View File

@ -37,113 +37,172 @@
/* vnode operations returns EIO */
static int ErrorVopCreate(struct Vnode *parent, const char *name, int mode, struct Vnode **vnode)
{
(void)parent;
(void)name;
(void)mode;
(void)vnode;
return -EIO;
}
static int ErrorVopLookup(struct Vnode *parent, const char *name, int len, struct Vnode **vnode)
{
(void)parent;
(void)name;
(void)len;
(void)vnode;
return -EIO;
}
static int ErrorVopOpen(struct Vnode *vnode, int fd, int mode, int flags)
{
(void)vnode;
(void)fd;
(void)mode;
(void)flags;
return -EIO;
}
static int ErrorVopClose(struct Vnode *vnode)
{
(void)vnode;
/* already closed at force umount, do nothing here */
return OK;
}
static int ErrorVopReclaim(struct Vnode *vnode)
{
(void)vnode;
return -EIO;
}
static int ErrorVopUnlink(struct Vnode *parent, struct Vnode *vnode, const char *fileName)
{
(void)parent;
(void)vnode;
(void)fileName;
return -EIO;
}
static int ErrorVopRmdir(struct Vnode *parent, struct Vnode *vnode, const char *dirName)
{
(void)parent;
(void)vnode;
(void)dirName;
return -EIO;
}
static int ErrorVopMkdir(struct Vnode *parent, const char *dirName, mode_t mode, struct Vnode **vnode)
{
(void)parent;
(void)dirName;
(void)mode;
(void)vnode;
return -EIO;
}
static int ErrorVopReaddir(struct Vnode *vnode, struct fs_dirent_s *dir)
{
(void)vnode;
(void)dir;
return -EIO;
}
static int ErrorVopOpendir(struct Vnode *vnode, struct fs_dirent_s *dir)
{
(void)vnode;
(void)dir;
return -EIO;
}
static int ErrorVopRewinddir(struct Vnode *vnode, struct fs_dirent_s *dir)
{
(void)vnode;
(void)dir;
return -EIO;
}
static int ErrorVopClosedir(struct Vnode *vnode, struct fs_dirent_s *dir)
{
(void)vnode;
(void)dir;
/* already closed at force umount, do nothing here */
return OK;
}
static int ErrorVopGetattr(struct Vnode *vnode, struct stat *st)
{
(void)vnode;
(void)st;
return -EIO;
}
static int ErrorVopSetattr(struct Vnode *vnode, struct stat *st)
{
(void)vnode;
(void)st;
return -EIO;
}
static int ErrorVopChattr(struct Vnode *vnode, struct IATTR *attr)
{
(void)vnode;
(void)attr;
return -EIO;
}
static int ErrorVopRename(struct Vnode *src, struct Vnode *dstParent, const char *srcName, const char *dstName)
{
(void)src;
(void)dstParent;
(void)srcName;
(void)dstName;
return -EIO;
}
static int ErrorVopTruncate(struct Vnode *vnode, off_t len)
{
(void)vnode;
(void)len;
return -EIO;
}
static int ErrorVopTruncate64(struct Vnode *vnode, off64_t len)
{
(void)vnode;
(void)len;
return -EIO;
}
static int ErrorVopFscheck(struct Vnode *vnode, struct fs_dirent_s *dir)
{
(void)vnode;
(void)dir;
return -EIO;
}
static int ErrorVopLink(struct Vnode *src, struct Vnode *dstParent, struct Vnode **dst, const char *dstName)
{
(void)src;
(void)dstParent;
(void)dst;
(void)dstName;
return -EIO;
}
static int ErrorVopSymlink(struct Vnode *parentVnode, struct Vnode **newVnode, const char *path, const char *target)
{
(void)parentVnode;
(void)newVnode;
(void)path;
(void)target;
return -EIO;
}
static ssize_t ErrorVopReadlink(struct Vnode *vnode, char *buffer, size_t bufLen)
{
(void)vnode;
(void)buffer;
(void)bufLen;
return -EIO;
}
@ -175,72 +234,105 @@ static struct VnodeOps g_errorVnodeOps = {
/* file operations returns EIO */
static int ErrorFopOpen(struct file *filep)
{
(void)filep;
return -EIO;
}
static int ErrorFopClose(struct file *filep)
{
(void)filep;
/* already closed at force umount, do nothing here */
return OK;
}
static ssize_t ErrorFopRead(struct file *filep, char *buffer, size_t buflen)
{
(void)filep;
(void)buffer;
(void)buflen;
return -EIO;
}
static ssize_t ErrorFopWrite(struct file *filep, const char *buffer, size_t buflen)
{
(void)filep;
(void)buffer;
(void)buflen;
return -EIO;
}
static off_t ErrorFopSeek(struct file *filep, off_t offset, int whence)
{
(void)filep;
(void)offset;
(void)whence;
return -EIO;
}
static int ErrorFopIoctl(struct file *filep, int cmd, unsigned long arg)
{
(void)filep;
(void)cmd;
(void)arg;
return -EIO;
}
static int ErrorFopMmap(struct file* filep, struct VmMapRegion *region)
{
(void)filep;
(void)region;
return -EIO;
}
static int ErrorFopPoll(struct file *filep, poll_table *fds)
{
(void)filep;
(void)fds;
return -EIO;
}
static int ErrorFopStat(struct file *filep, struct stat* st)
{
(void)filep;
(void)st;
return -EIO;
}
static int ErrorFopFallocate(struct file* filep, int mode, off_t offset, off_t len)
{
(void)filep;
(void)mode;
(void)offset;
(void)len;
return -EIO;
}
static int ErrorFopFallocate64(struct file *filep, int mode, off64_t offset, off64_t len)
{
(void)filep;
(void)mode;
(void)offset;
(void)len;
return -EIO;
}
static int ErrorFopFsync(struct file *filep)
{
(void)filep;
return -EIO;
}
static ssize_t ErrorFopReadpage(struct file *filep, char *buffer, size_t buflen)
{
(void)filep;
(void)buffer;
(void)buflen;
return -EIO;
}
static int ErrorFopUnlink(struct Vnode *vnode)
{
(void)vnode;
return -EIO;
}

View File

@ -45,7 +45,6 @@
#ifdef LOSCFG_DRIVERS_TZDRIVER
#include "fs/file.h"
#endif
#include "fs/file.h"
#include "unistd.h"
#ifdef __cplusplus

View File

@ -65,7 +65,6 @@
#include "lwip/api_shell.h"
#include "lwip/dns.h"
#include "lwip/netdb.h"
#include "lwip/udp.h"
#include "lwip/priv/tcp_priv.h"

View File

@ -34,8 +34,6 @@
#include <lwip/snmp.h>
#include <lwip/etharp.h>
#include <lwip/sockets.h>
#include <lwip/snmp.h>
#include <lwip/etharp.h>
#include <lwip/ethip6.h>
#define LWIP_NETIF_HOSTNAME_DEFAULT "default"

View File

@ -57,8 +57,6 @@
#include "sys/prctl.h"
#include "sys/socket.h"
#include "sys/utsname.h"
#include "poll.h"
#include "sys/uio.h"
#ifdef LOSCFG_SHELL
#include "shmsg.h"
#endif

View File

@ -63,7 +63,6 @@
#include "epoll.h"
#endif
#include <sys/wait.h>
#include "sys/resource.h"
#ifdef LOSCFG_FS_VFS
#include "vnode.h"
#endif

View File

@ -44,9 +44,6 @@
#include "shmsg.h"
#endif
#include "user_copy.h"
#include "los_strncpy_from_user.h"
#include "capability_type.h"
#include "capability_api.h"
#include "unistd.h"