LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] ocfs2: remove set but not used variable 'last_hash'
@ 2019-07-16 13:21 YueHaibing
  2019-07-17  0:46 ` Joseph Qi
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2019-07-16 13:21 UTC (permalink / raw)
  To: mark, jlbec, joseph.qi, akpm; +Cc: linux-kernel, ocfs2-devel, YueHaibing

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

fs/ocfs2/xattr.c: In function ocfs2_xattr_bucket_find:
fs/ocfs2/xattr.c:3828:6: warning: variable last_hash set but not used [-Wunused-but-set-variable]

It's never used and can be removed.

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

diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 385f3aa..90c830e3 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -3825,7 +3825,6 @@ static int ocfs2_xattr_bucket_find(struct inode *inode,
 	u16 blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb);
 	int low_bucket = 0, bucket, high_bucket;
 	struct ocfs2_xattr_bucket *search;
-	u32 last_hash;
 	u64 blkno, lower_blkno = 0;
 
 	search = ocfs2_xattr_bucket_new(inode);
@@ -3869,8 +3868,6 @@ static int ocfs2_xattr_bucket_find(struct inode *inode,
 		if (xh->xh_count)
 			xe = &xh->xh_entries[le16_to_cpu(xh->xh_count) - 1];
 
-		last_hash = le32_to_cpu(xe->xe_name_hash);
-
 		/* record lower_blkno which may be the insert place. */
 		lower_blkno = blkno;
 
-- 
2.7.4



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

* Re: [PATCH] ocfs2: remove set but not used variable 'last_hash'
  2019-07-16 13:21 [PATCH] ocfs2: remove set but not used variable 'last_hash' YueHaibing
@ 2019-07-17  0:46 ` Joseph Qi
  0 siblings, 0 replies; 2+ messages in thread
From: Joseph Qi @ 2019-07-17  0:46 UTC (permalink / raw)
  To: YueHaibing, mark, jlbec, akpm; +Cc: linux-kernel, ocfs2-devel



On 19/7/16 21:21, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> fs/ocfs2/xattr.c: In function ocfs2_xattr_bucket_find:
> fs/ocfs2/xattr.c:3828:6: warning: variable last_hash set but not used [-Wunused-but-set-variable]
> 
> It's never used and can be removed.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
>  fs/ocfs2/xattr.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
> index 385f3aa..90c830e3 100644
> --- a/fs/ocfs2/xattr.c
> +++ b/fs/ocfs2/xattr.c
> @@ -3825,7 +3825,6 @@ static int ocfs2_xattr_bucket_find(struct inode *inode,
>  	u16 blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb);
>  	int low_bucket = 0, bucket, high_bucket;
>  	struct ocfs2_xattr_bucket *search;
> -	u32 last_hash;
>  	u64 blkno, lower_blkno = 0;
>  
>  	search = ocfs2_xattr_bucket_new(inode);
> @@ -3869,8 +3868,6 @@ static int ocfs2_xattr_bucket_find(struct inode *inode,
>  		if (xh->xh_count)
>  			xe = &xh->xh_entries[le16_to_cpu(xh->xh_count) - 1];
>  
> -		last_hash = le32_to_cpu(xe->xe_name_hash);
> -
>  		/* record lower_blkno which may be the insert place. */
>  		lower_blkno = blkno;
>  
> 

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

end of thread, other threads:[~2019-07-17  0:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-16 13:21 [PATCH] ocfs2: remove set but not used variable 'last_hash' YueHaibing
2019-07-17  0:46 ` Joseph Qi

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).