[PATCH] exfat: Drop dead assignment of num_clusters

Philipp Hahn posted 1 patch 1 month, 1 week ago
fs/exfat/inode.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] exfat: Drop dead assignment of num_clusters
Posted by Philipp Hahn 1 month, 1 week ago
num_clusters is not used naywhere afterwards. Remove assignment.

Found by static code analysis using Klocwork.

Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
---
 fs/exfat/inode.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c
index 2fb2d2d5d503a..d17ef2f9a7e2b 100644
--- a/fs/exfat/inode.c
+++ b/fs/exfat/inode.c
@@ -213,7 +213,6 @@ static int exfat_map_cluster(struct inode *inode, unsigned int clu_offset,
 					return -EIO;
 		}
 
-		num_clusters += num_to_be_allocated;
 		*clu = new_clu.dir;
 
 		inode->i_blocks += EXFAT_CLU_TO_B(num_to_be_allocated, sbi) >> 9;
-- 
2.43.0
Re: [PATCH] exfat: Drop dead assignment of num_clusters
Posted by Markus Elfring 1 month, 1 week ago
> num_clusters is not used naywhere afterwards. …

                           anywhere?

Regards,
Markus
Re: [PATCH] exfat: Drop dead assignment of num_clusters
Posted by Philipp Hahn 1 month ago
Hello Markus,

Am Tue, Mar 03, 2026 at 12:50:07PM +0100 schrieb Markus Elfring:
> > num_clusters is not used naywhere afterwards. …
> 
>                            anywhere?

Yes, obviously. Thank you for spotting this.

Philipp