Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH -next] btrfs: remove set but not used variable 'root_objectid'
@ 2020-01-08 12:58 YueHaibing
  2020-01-08 13:40 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2020-01-08 12:58 UTC (permalink / raw)
  To: clm, josef, dsterba; +Cc: linux-btrfs, linux-kernel, YueHaibing

fs/btrfs/inode.c: In function btrfs_rename:
fs/btrfs/inode.c:9196:6: warning: variable root_objectid set but not used [-Wunused-but-set-variable]

commit f8b3030e0807 ("btrfs: rework arguments of btrfs_unlink_subvol")
left behind this unused variable.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 fs/btrfs/inode.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 493c0fe..990f509 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -9204,7 +9204,6 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
 	struct inode *new_inode = d_inode(new_dentry);
 	struct inode *old_inode = d_inode(old_dentry);
 	u64 index = 0;
-	u64 root_objectid;
 	int ret;
 	u64 old_ino = btrfs_ino(BTRFS_I(old_inode));
 	bool log_pinned = false;
@@ -9331,7 +9330,6 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
 		new_inode->i_ctime = current_time(new_inode);
 		if (unlikely(btrfs_ino(BTRFS_I(new_inode)) ==
 			     BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) {
-			root_objectid = BTRFS_I(new_inode)->location.objectid;
 			ret = btrfs_unlink_subvol(trans, new_dir, new_dentry);
 			BUG_ON(new_inode->i_nlink == 0);
 		} else {
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] btrfs: remove set but not used variable 'root_objectid'
  2020-01-08 12:58 [PATCH -next] btrfs: remove set but not used variable 'root_objectid' YueHaibing
@ 2020-01-08 13:40 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2020-01-08 13:40 UTC (permalink / raw)
  To: YueHaibing; +Cc: clm, josef, dsterba, linux-btrfs, linux-kernel

On Wed, Jan 08, 2020 at 08:58:35PM +0800, YueHaibing wrote:
> fs/btrfs/inode.c: In function btrfs_rename:
> fs/btrfs/inode.c:9196:6: warning: variable root_objectid set but not used [-Wunused-but-set-variable]
> 
> commit f8b3030e0807 ("btrfs: rework arguments of btrfs_unlink_subvol")
> left behind this unused variable.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Thanks, I'll fold it to the patch.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-08 13:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-08 12:58 [PATCH -next] btrfs: remove set but not used variable 'root_objectid' YueHaibing
2020-01-08 13:40 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox