Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Oct 2017 16:42:03 +0000 (UTC)
From:      Fedor Uporov <fsu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r324759 - head/sys/fs/ext2fs
Message-ID:  <201710191642.v9JGg3bM038746@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: fsu
Date: Thu Oct 19 16:42:03 2017
New Revision: 324759
URL: https://svnweb.freebsd.org/changeset/base/324759

Log:
  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

Modified:
  head/sys/fs/ext2fs/ext2_extents.c

Modified: head/sys/fs/ext2fs/ext2_extents.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_extents.c	Thu Oct 19 16:40:17 2017	(r324758)
+++ head/sys/fs/ext2fs/ext2_extents.c	Thu Oct 19 16:42:03 2017	(r324759)
@@ -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_
     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_
 			    ("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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201710191642.v9JGg3bM038746>