From owner-svn-src-all@freebsd.org Thu Oct 19 16:42:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25605E40266; Thu, 19 Oct 2017 16:42:05 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E755070645; Thu, 19 Oct 2017 16:42:04 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9JGg3rD038747; Thu, 19 Oct 2017 16:42:03 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9JGg3bM038746; Thu, 19 Oct 2017 16:42:03 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201710191642.v9JGg3bM038746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Thu, 19 Oct 2017 16:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324759 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 324759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 16:42:05 -0000 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)