From 4140eed8a150cb028b3765a34c801f28068fda8c Mon Sep 17 00:00:00 2001 From: fsu Date: Thu, 19 Oct 2017 16:42:03 +0000 Subject: [PATCH] Fix unused variable + style(9) fixes inside the ext4_ext_find_extent() Approved by: pfg (mentor) Reported by: Coverity CID: 1381754 MFC after: 6 months --- sys/fs/ext2fs/ext2_extents.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/fs/ext2fs/ext2_extents.c b/sys/fs/ext2fs/ext2_extents.c index 788f089e29a6..c7bd74a44cda 100644 --- a/sys/fs/ext2fs/ext2_extents.c +++ b/sys/fs/ext2fs/ext2_extents.c @@ -377,11 +377,11 @@ ext4_ext_find_extent(struct inode *ip, daddr_t block, if (error) return (error); - if (!ppath) + if (ppath == NULL) return (EINVAL); path = *ppath; - if (!path) { + if (path == NULL) { path = malloc(EXT4_EXT_DEPTH_MAX * sizeof(struct ext4_extent_path), M_EXT2EXTENTS, M_WAITOK | M_ZERO); @@ -1349,7 +1349,7 @@ ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_path *path, uint64_t start) { struct m_ext2fs *fs; - int depth, credits; + int depth; struct ext4_extent_header *eh; unsigned int a, b, block, num; unsigned long ex_blk; @@ -1402,11 +1402,8 @@ ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_path *path, ("ext4_ext_rm_leaf: bad b")); } - credits = EXT4_EXT_DEPTH_MAX; - if (ex == EXT_FIRST_EXTENT(eh)) { + if (ex == EXT_FIRST_EXTENT(eh)) correct_index = 1; - credits += (ext4_ext_inode_depth(ip)) + 1; - } error = ext4_remove_blocks(ip, ex, a, b); if (error)