linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] btrfs: remove set but not used variable 'num_pages'
@ 2018-12-15  6:31 YueHaibing
  2018-12-17  3:02 ` Anand Jain
  2019-01-04 15:51 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2018-12-15  6:31 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba
  Cc: YueHaibing, linux-btrfs, kernel-janitors

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

fs/btrfs/ioctl.c: In function 'btrfs_extent_same':
fs/btrfs/ioctl.c:3260:6: warning:
 variable 'num_pages' set but not used [-Wunused-but-set-variable]

It not used any more since commit 9ee8234e6220 ("Btrfs: use
generic_remap_file_range_prep() for cloning and deduplication")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 fs/btrfs/ioctl.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index fab9443..15fc467 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -3257,7 +3257,6 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen,
 			     struct inode *dst, u64 dst_loff)
 {
 	int ret;
-	int num_pages = PAGE_ALIGN(BTRFS_MAX_DEDUPE_LEN) >> PAGE_SHIFT;
 	u64 i, tail_len, chunk_count;
 
 	/* don't make the dst file partly checksummed */
@@ -3270,8 +3269,6 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen,
 
 	tail_len = olen % BTRFS_MAX_DEDUPE_LEN;
 	chunk_count = div_u64(olen, BTRFS_MAX_DEDUPE_LEN);
-	if (chunk_count == 0)
-		num_pages = PAGE_ALIGN(tail_len) >> PAGE_SHIFT;
 
 	for (i = 0; i < chunk_count; i++) {
 		ret = btrfs_extent_same_range(src, loff, BTRFS_MAX_DEDUPE_LEN,




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

* Re: [PATCH -next] btrfs: remove set but not used variable 'num_pages'
  2018-12-15  6:31 [PATCH -next] btrfs: remove set but not used variable 'num_pages' YueHaibing
@ 2018-12-17  3:02 ` Anand Jain
  2019-01-04 15:51 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Anand Jain @ 2018-12-17  3:02 UTC (permalink / raw)
  To: linux-btrfs; +Cc: YueHaibing, David Sterba


(cc-list-updated)

On 12/15/2018 02:31 PM, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> fs/btrfs/ioctl.c: In function 'btrfs_extent_same':
> fs/btrfs/ioctl.c:3260:6: warning:
>   variable 'num_pages' set but not used [-Wunused-but-set-variable]
> 
> It not used any more since commit 9ee8234e6220 ("Btrfs: use
> generic_remap_file_range_prep() for cloning and deduplication")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

This can be rolled up to 9ee8234e6220.

Reviewed-by: Anand Jain <anand.jain@oracle.com>


> ---
>   fs/btrfs/ioctl.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index fab9443..15fc467 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -3257,7 +3257,6 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen,
>   			     struct inode *dst, u64 dst_loff)
>   {
>   	int ret;
> -	int num_pages = PAGE_ALIGN(BTRFS_MAX_DEDUPE_LEN) >> PAGE_SHIFT;
>   	u64 i, tail_len, chunk_count;
>   
>   	/* don't make the dst file partly checksummed */
> @@ -3270,8 +3269,6 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen,
>   
>   	tail_len = olen % BTRFS_MAX_DEDUPE_LEN;
>   	chunk_count = div_u64(olen, BTRFS_MAX_DEDUPE_LEN);
> -	if (chunk_count == 0)
> -		num_pages = PAGE_ALIGN(tail_len) >> PAGE_SHIFT;
>   
>   	for (i = 0; i < chunk_count; i++) {
>   		ret = btrfs_extent_same_range(src, loff, BTRFS_MAX_DEDUPE_LEN,
> 
> 
> 

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

* Re: [PATCH -next] btrfs: remove set but not used variable 'num_pages'
  2018-12-15  6:31 [PATCH -next] btrfs: remove set but not used variable 'num_pages' YueHaibing
  2018-12-17  3:02 ` Anand Jain
@ 2019-01-04 15:51 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2019-01-04 15:51 UTC (permalink / raw)
  To: YueHaibing
  Cc: Chris Mason, Josef Bacik, David Sterba, linux-btrfs, kernel-janitors

On Sat, Dec 15, 2018 at 06:31:07AM +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> fs/btrfs/ioctl.c: In function 'btrfs_extent_same':
> fs/btrfs/ioctl.c:3260:6: warning:
>  variable 'num_pages' set but not used [-Wunused-but-set-variable]
> 
> It not used any more since commit 9ee8234e6220 ("Btrfs: use
> generic_remap_file_range_prep() for cloning and deduplication")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Added to patch queue, thanks.

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

end of thread, other threads:[~2019-01-04 15:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-15  6:31 [PATCH -next] btrfs: remove set but not used variable 'num_pages' YueHaibing
2018-12-17  3:02 ` Anand Jain
2019-01-04 15:51 ` 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).