linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs: remove unused pointer 'tree'
@ 2018-08-28 13:21 Colin King
  2018-09-06 16:08 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-08-28 13:21 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba, linux-btrfs
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Pointer 'tree' is being assigned but is never used hence it is
redundant and can be removed.

Cleans up clang warning:
warning: variable 'tree' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 fs/btrfs/compression.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 9bfa66592aa7..8703ce68fe9d 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -528,7 +528,6 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
 				 int mirror_num, unsigned long bio_flags)
 {
 	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
-	struct extent_io_tree *tree;
 	struct extent_map_tree *em_tree;
 	struct compressed_bio *cb;
 	unsigned long compressed_len;
@@ -545,7 +544,6 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
 	int faili = 0;
 	u32 *sums;
 
-	tree = &BTRFS_I(inode)->io_tree;
 	em_tree = &BTRFS_I(inode)->extent_tree;
 
 	/* we need the actual starting offset of this extent in the file */
-- 
2.17.1


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

* Re: [PATCH] btrfs: remove unused pointer 'tree'
  2018-08-28 13:21 [PATCH] btrfs: remove unused pointer 'tree' Colin King
@ 2018-09-06 16:08 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2018-09-06 16:08 UTC (permalink / raw)
  To: Colin King
  Cc: Chris Mason, Josef Bacik, David Sterba, linux-btrfs,
	kernel-janitors, linux-kernel

On Tue, Aug 28, 2018 at 02:21:01PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Pointer 'tree' is being assigned but is never used hence it is
> redundant and can be removed.

For patches removing dead code it's good to do a bit of research what
was the reason for that. In most cases it's a simple leftover after some
other cleanup or rework, ie. harmless, but this needs to be reviewed
anyway and the reference in changelog helps.

In this case it's after my commit 00032d38eaa89c76de7, I'll update the
changelog. And the previous patch removing inode in relink_file_extents
was udpated too.
> 
> Cleans up clang warning:
> warning: variable 'tree' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: David Sterba <dsterba@suse.com>

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

end of thread, other threads:[~2018-09-06 16:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-28 13:21 [PATCH] btrfs: remove unused pointer 'tree' Colin King
2018-09-06 16:08 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).