Skip to contentSkip to conversation

udf: remove redundant variable netype

PATCH In review Colin Ian King 2 participants 2 messages Jan 5, 2023 – Jan 6, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udf: remove redundant variable netype

The variable netype is assigned a value that is never read, the assignment is redundant the variable can be removed.

Cleans up clang scan-build warning:
fs/exfat/dir.c:1012:5: warning: Value stored to 'step' is never read

---
 fs/udf/truncate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/udf/truncate.c +2 -2
index 036ebd892b85..775edaba82ee 100644
@@ -125,7 +125,7 @@ void udf_discard_prealloc(struct inode *inode)
 	struct kernel_lb_addr eloc;
 	uint32_t elen;
 	uint64_t lbcount = 0;
-	int8_t etype = -1, netype;
+	int8_t etype = -1;
 	struct udf_inode_info *iinfo = UDF_I(inode);
 	int bsize = 1 << inode->i_blkbits;
 
@@ -136,7 +136,7 @@ void udf_discard_prealloc(struct inode *inode)
 	epos.block = iinfo->i_location;
 
 	/* Find the last extent in the file */
-	while ((netype = udf_next_aext(inode, &epos, &eloc, &elen, 0)) != -1) {
+	while (udf_next_aext(inode, &epos, &eloc, &elen, 0) != -1) {
 		brelse(prev_epos.bh);
 		prev_epos = epos;
 		if (prev_epos.bh)
Signature · 1 line
2.30.2
#1 lore raw
Quoted 7 lines · Colin Ian King

The variable netype is assigned a value that is never read, the assignment is redundant the variable can be removed.

Cleans up clang scan-build warning:
fs/exfat/dir.c:1012:5: warning: Value stored to 'step' is never read

Thanks, I've added the patch to my tree. Just the warning message mentioned in the changelog is apparently from somewhere else so I've just deleted it ;).

Honza

Quoted 29 lines
---
 fs/udf/truncate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/udf/truncate.c +2 -2
index 036ebd892b85..775edaba82ee 100644
@@ -125,7 +125,7 @@ void udf_discard_prealloc(struct inode *inode)
 	struct kernel_lb_addr eloc;
 	uint32_t elen;
 	uint64_t lbcount = 0;
-	int8_t etype = -1, netype;
+	int8_t etype = -1;
 	struct udf_inode_info *iinfo = UDF_I(inode);
 	int bsize = 1 << inode->i_blkbits;
 
@@ -136,7 +136,7 @@ void udf_discard_prealloc(struct inode *inode)
 	epos.block = iinfo->i_location;
 
 	/* Find the last extent in the file */
-	while ((netype = udf_next_aext(inode, &epos, &eloc, &elen, 0)) != -1) {
+	while (udf_next_aext(inode, &epos, &eloc, &elen, 0) != -1) {
 		brelse(prev_epos.bh);
 		prev_epos = epos;
 		if (prev_epos.bh)
Signature · 1 line
2.30.2
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR