2019-07-02 14:17:50

by Yue Haibing

[permalink] [raw]
Subject: [PATCH -next] btrfs: remove set but not used variable 'offset'

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

fs/btrfs/volumes.c: In function __btrfs_map_block:
fs/btrfs/volumes.c:6023:6: warning:
variable offset set but not used [-Wunused-but-set-variable]

It is not used any more since commit 343abd1c0ca9 ("btrfs: Use
btrfs_get_io_geometry appropriately")

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: YueHaibing <[email protected]>
---
fs/btrfs/volumes.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index d1fd910..5d5a9ff 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -6020,7 +6020,6 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info,
{
struct extent_map *em;
struct map_lookup *map;
- u64 offset;
u64 stripe_offset;
u64 stripe_nr;
u64 stripe_len;
@@ -6055,7 +6054,6 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info,
map = em->map_lookup;

*length = geom.len;
- offset = geom.offset;
stripe_len = geom.stripe_len;
stripe_nr = geom.stripe_nr;
stripe_offset = geom.stripe_offset;
--
2.7.4



2019-07-03 03:52:39

by Anand Jain

[permalink] [raw]
Subject: Re: [PATCH -next] btrfs: remove set but not used variable 'offset'

On 2/7/19 10:15 PM, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> fs/btrfs/volumes.c: In function __btrfs_map_block:
> fs/btrfs/volumes.c:6023:6: warning:
> variable offset set but not used [-Wunused-but-set-variable]
>
> It is not used any more since commit 343abd1c0ca9 ("btrfs: Use
> btrfs_get_io_geometry appropriately")
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: YueHaibing <[email protected]>


Reviewed-by: Anand Jain <[email protected]>


> ---
> fs/btrfs/volumes.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index d1fd910..5d5a9ff 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -6020,7 +6020,6 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info,
> {
> struct extent_map *em;
> struct map_lookup *map;
> - u64 offset;
> u64 stripe_offset;
> u64 stripe_nr;
> u64 stripe_len;
> @@ -6055,7 +6054,6 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info,
> map = em->map_lookup;
>
> *length = geom.len;
> - offset = geom.offset;
> stripe_len = geom.stripe_len;
> stripe_nr = geom.stripe_nr;
> stripe_offset = geom.stripe_offset;
>

2019-07-17 15:04:45

by David Sterba

[permalink] [raw]
Subject: Re: [PATCH -next] btrfs: remove set but not used variable 'offset'

On Tue, Jul 02, 2019 at 10:15:21PM +0800, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> fs/btrfs/volumes.c: In function __btrfs_map_block:
> fs/btrfs/volumes.c:6023:6: warning:
> variable offset set but not used [-Wunused-but-set-variable]
>
> It is not used any more since commit 343abd1c0ca9 ("btrfs: Use
> btrfs_get_io_geometry appropriately")
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: YueHaibing <[email protected]>

Added to misc-next, thanks.