Skip to contentSkip to conversation

fs/ocfs2: remove set but not used variables

PATCH RESEND New Joseph Qi 2 participants 5 messages Aug 23, 2019 – Aug 24, 2019 OCFS2

lore
Share & tools
lore

Joseph Qi

author maintainer
#0 lore raw

cover fs/ocfs2: remove set but not used variables

zhengbin (3):
fs/ocfs2/namei.c: remove set but not used variables fs/ocfs2/file.c: remove set but not used variables fs/ocfs2/dir.c: remove set but not used variables

 fs/ocfs2/dir.c   | 3 +--
 fs/ocfs2/file.c  | 3 ---
 fs/ocfs2/namei.c | 2 --
 3 files changed, 1 insertion(+), 7 deletions(-)
Signature · 1 line
1.8.3.1
author maintainer
#1 lore raw

PATCH 1/3 fs/ocfs2/namei.c: remove set but not used variables

From: zhengbin <[email protected]>

Fixes gcc '-Wunused-but-set-variable' warning:

fs/ocfs2/namei.c: In function ocfs2_create_inode_in_orphan:
fs/ocfs2/namei.c:2503:23: warning: variable di set but not used [-Wunused-but-set-variable]

---
 fs/ocfs2/namei.c | 2 --
 1 file changed, 2 deletions(-)
fs/ocfs2/namei.c +0 -2
index 6f8e1c4..8ea51cf 100644
@@ -2486,7 +2486,6 @@ int ocfs2_create_inode_in_orphan(struct inode *dir,
 	struct inode *inode = NULL;
 	struct inode *orphan_dir = NULL;
 	struct ocfs2_super *osb = OCFS2_SB(dir->i_sb);
-	struct ocfs2_dinode *di = NULL;
 	handle_t *handle = NULL;
 	char orphan_name[OCFS2_ORPHAN_NAMELEN + 1];
 	struct buffer_head *parent_di_bh = NULL;
@@ -2552,7 +2551,6 @@ int ocfs2_create_inode_in_orphan(struct inode *dir,
 		goto leave;
 	}
 
-	di = (struct ocfs2_dinode *)new_di_bh->b_data;
 	status = ocfs2_orphan_add(osb, handle, inode, new_di_bh, orphan_name,
 				  &orphan_insert, orphan_dir, false);
 	if (status < 0) {
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 1/3 fs/ocfs2/namei.c: remove set but not used variables

Quoted 11 lines · On Fri, 23 Aug 2019 09:09:46 +0800 Joseph Qi <[email protected]>…

From: zhengbin <[email protected]>

Fixes gcc '-Wunused-but-set-variable' warning:

fs/ocfs2/namei.c: In function ocfs2_create_inode_in_orphan:
fs/ocfs2/namei.c:2503:23: warning: variable di set but not used [-Wunused-but-set-variable]

Thanks. I added your Signed-off-by: to these, as you were on the patch delivery path.

author maintainer
#3 lore raw

PATCH 2/3 fs/ocfs2/file.c: remove set but not used variables

In reply to Joseph Qi

From: zhengbin <[email protected]>

Fixes gcc '-Wunused-but-set-variable' warning:

fs/ocfs2/file.c: In function ocfs2_prepare_inode_for_write:
fs/ocfs2/file.c:2143:9: warning: variable end set but not used [-Wunused-but-set-variable]

---
 fs/ocfs2/file.c | 3 ---
 1 file changed, 3 deletions(-)
fs/ocfs2/file.c +0 -3
index efe9988..2e982db 100644
@@ -2130,7 +2130,6 @@ static int ocfs2_prepare_inode_for_write(struct file *file,
 	struct dentry *dentry = file->f_path.dentry;
 	struct inode *inode = d_inode(dentry);
 	struct buffer_head *di_bh = NULL;
-	loff_t end;
 
 	/*
 	 * We start with a read level meta lock and only jump to an ex
@@ -2194,8 +2193,6 @@ static int ocfs2_prepare_inode_for_write(struct file *file,
 			}
 		}
 
-		end = pos + count;
-
 		ret = ocfs2_check_range_for_refcount(inode, pos, count);
 		if (ret == 1) {
 			ocfs2_inode_unlock(inode, meta_level);
Signature · 1 line
1.8.3.1
author maintainer
#4 lore raw

PATCH 3/3 fs/ocfs2/dir.c: remove set but not used variables

In reply to Joseph Qi

From: zhengbin <[email protected]>

Fixes gcc '-Wunused-but-set-variable' warning:

fs/ocfs2/dir.c: In function ocfs2_dx_dir_transfer_leaf:
fs/ocfs2/dir.c:3653:42: warning: variable new_list set but not used [-Wunused-but-set-variable]

---
 fs/ocfs2/dir.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/ocfs2/dir.c +1 -2
index 784426d..bdef72c 100644
@@ -3636,7 +3636,7 @@ static void ocfs2_dx_dir_transfer_leaf(struct inode *dir, u32 split_hash,
 	int i, j, num_used;
 	u32 major_hash;
 	struct ocfs2_dx_leaf *orig_dx_leaf, *new_dx_leaf;
-	struct ocfs2_dx_entry_list *orig_list, *new_list, *tmp_list;
+	struct ocfs2_dx_entry_list *orig_list, *tmp_list;
 	struct ocfs2_dx_entry *dx_entry;
 
 	tmp_list = &tmp_dx_leaf->dl_list;
@@ -3645,7 +3645,6 @@ static void ocfs2_dx_dir_transfer_leaf(struct inode *dir, u32 split_hash,
 		orig_dx_leaf = (struct ocfs2_dx_leaf *) orig_dx_leaves[i]->b_data;
 		orig_list = &orig_dx_leaf->dl_list;
 		new_dx_leaf = (struct ocfs2_dx_leaf *) new_dx_leaves[i]->b_data;
-		new_list = &new_dx_leaf->dl_list;
 
 		num_used = le16_to_cpu(orig_list->de_num_used);
 
Signature · 1 line
1.8.3.1