Re: [PATCH][next] ext2: remove redundant assignment to variable desc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 30/06/2023 17:47, Dan Carpenter wrote:
On Fri, Jun 30, 2023 at 05:30:33PM +0100, Colin Ian King wrote:
Variable desc is being assigned a value that is never read, the exit
via label found immeditely returns with no access to desc. The
assignment is redundant and can be removed. Cleans up clang scan
muild warning:

fs/ext2/ialloc.c:297:4: warning: Value stored to 'desc' is never
read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@xxxxxxxxx>
---
  fs/ext2/ialloc.c | 1 -
  1 file changed, 1 deletion(-)

diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c
index a4e1d7a9c544..f50beb77d6ba 100644
--- a/fs/ext2/ialloc.c
+++ b/fs/ext2/ialloc.c
@@ -294,7 +294,6 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent)
  			best_desc = desc;
  		}
  		if (best_group >= 0) {
-			desc = best_desc;

You should get rid of the "best_desc" variable as well.

Good point! Will send V2. Thanks Dan.


regards,
dan carpenter





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux