[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH v2 4/5] lib/devfs: Fix checkpath warnings
Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx> --- lib/devfs/devfs_vnops.c | 33 +++++++++++++++++---------------- lib/devfs/device.c | 9 ++++----- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/devfs/devfs_vnops.c b/lib/devfs/devfs_vnops.c index 617ed359..67a35aa6 100644 --- a/lib/devfs/devfs_vnops.c +++ b/lib/devfs/devfs_vnops.c @@ -77,21 +77,21 @@ devfs_open(struct vfscore_file *fp) struct device *dev; int error; - DPRINTF(("devfs_open: path=%s\n", path)); + DPRINTF(("%s: path=%s\n", __func__, path)); if (!strcmp(path, "/")) /* root ? */ return 0; if (vp->v_flags & VPROTDEV) { - DPRINTF(("devfs_open: failed to open protected device.\n")); + DPRINTF(("%s: failed to open protected device.\n", __func__)); return EPERM; } if (*path == '/') path++; error = device_open(path, fp->f_flags & DO_RWMASK, &dev); if (error) { - DPRINTF(("devfs_open: can not open device = %s error=%d\n", - path, error)); + DPRINTF(("%s: can not open device = %s error=%d\n", + __func__, path, error)); return error; } vp->v_data = (void *)dev; /* Store private data */ @@ -102,24 +102,25 @@ static int devfs_close(struct vnode *vp, struct vfscore_file *fp) { - DPRINTF(("devfs_close: fp=%x\n", fp)); + DPRINTF(("%s: fp=%x\n", __func__, fp)); if (!strcmp(fp->f_dentry->d_path, "/")) /* root ? */ return 0; - return device_close((struct device*)vp->v_data); + return device_close((struct device *)vp->v_data); } static int -devfs_read(struct vnode *vp, struct vfscore_file *fp, struct uio *uio, int ioflags) +devfs_read(struct vnode *vp, struct vfscore_file *fp, + struct uio *uio, int ioflags) { - return device_read((struct device*)vp->v_data, uio, ioflags); + return device_read((struct device *)vp->v_data, uio, ioflags); } static int devfs_write(struct vnode *vp, struct uio *uio, int ioflags) { - return device_write((struct device*)vp->v_data, uio, ioflags); + return device_write((struct device *)vp->v_data, uio, ioflags); } static int @@ -127,8 +128,8 @@ devfs_ioctl(struct vnode *vp, struct vfscore_file *fp, unsigned long cmd, void * { int error; - error = device_ioctl((struct device*)vp->v_data, cmd, arg); - DPRINTF(("devfs_ioctl: cmd=%x\n", cmd)); + error = device_ioctl((struct device *)vp->v_data, cmd, arg); + DPRINTF(("%s: cmd=%x\n", __func__, cmd)); return error; } @@ -139,7 +140,7 @@ devfs_lookup(struct vnode *dvp, char *name, struct vnode **vpp) struct vnode *vp; int error, i; - DPRINTF(("devfs_lookup:%s\n", name)); + DPRINTF(("%s:%s\n", __func__, name)); *vpp = NULL; @@ -151,9 +152,9 @@ devfs_lookup(struct vnode *dvp, char *name, struct vnode **vpp) info.cookie = 0; for (;;) { error = device_info(&info); - if (error) { + if (error) return ENOENT; - } + if (!strncmp(info.name, name, MAXDEVNAME)) break; i++; @@ -185,7 +186,7 @@ devfs_readdir(struct vnode *vp, struct vfscore_file *fp, struct dirent *dir) struct devinfo info; int error, i; - DPRINTF(("devfs_readdir offset=%d\n", fp->f_offset)); + DPRINTF(("%s: offset=%d\n", __func__, fp->f_offset)); i = 0; error = 0; @@ -205,7 +206,7 @@ devfs_readdir(struct vnode *vp, struct vfscore_file *fp, struct dirent *dir) dir->d_fileno = fp->f_offset; // dir->d_namlen = strlen(dir->d_name); - DPRINTF(("devfs_readdir: %s\n", dir->d_name)); + DPRINTF(("%s: %s\n", __func__, dir->d_name)); fp->f_offset++; return 0; } diff --git a/lib/devfs/device.c b/lib/devfs/device.c index f32b26dc..1e105f1e 100644 --- a/lib/devfs/device.c +++ b/lib/devfs/device.c @@ -57,7 +57,7 @@ static struct uk_mutex devfs_lock = UK_MUTEX_INITIALIZER(devfs_lock); /* list head of the devices */ -static struct device *device_list = NULL; +static struct device *device_list; /* * Look up a device object by device name. @@ -85,7 +85,7 @@ struct partition_table_entry { uint16_t ending_cylinder:10; uint32_t rela_sector; uint32_t total_sectors; -} __attribute__((packed)); +} __packed; void device_register(struct device *dev, const char *name, int flags) @@ -204,7 +204,7 @@ device_reference(struct device *dev) static int device_reference_locked(struct device *dev) { - UK_ASSERT(uk_mutex_is_locked(&devfs_lock)); + UK_ASSERT(uk_mutex_is_locked(&devfs_lock)); if (!device_valid(dev)) { uk_mutex_unlock(&devfs_lock); @@ -281,9 +281,8 @@ device_open(const char *name, int mode, struct device **devp) } error = device_reference_locked(dev); - if (error) { + if (error) return error; - } uk_mutex_unlock(&devfs_lock); ops = dev->driver->devops; -- 2.21.0 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |