Skip to contentSkip to conversation

libext2fs: remove unused variable in ext2fs_xattrs_read_inode()

PATCH In review Eric Biggers 2 participants 2 messages Jan 4, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libext2fs: remove unused variable in ext2fs_xattrs_read_inode()

From: Eric Biggers <[email protected]>

Address the following compiler warning with gcc -Wall:

ext_attr.c: In function ‘ext2fs_xattrs_read_inode’:
ext_attr.c:1000:16: warning: unused variable ‘i’ [-Wunused-variable]
1000 | size_t i;
| ^

Cc Andreas Dilger <[email protected]>
---
 lib/ext2fs/ext_attr.c | 1 -
 1 file changed, 1 deletion(-)
lib/ext2fs/ext_attr.c +0 -1
index d36fe68d..6fc4214c 100644
@@ -997,7 +997,6 @@ errcode_t ext2fs_xattrs_read_inode(struct ext2_xattr_handle *handle,
 	unsigned int storage_size;
 	char *start, *block_buf = NULL;
 	blk64_t blk;
-	size_t i;
 	errcode_t err = 0;
 
 	EXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EA_HANDLE);
Signature · 1 line
2.39.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Eric Biggers

From: Eric Biggers <[email protected]>

Address the following compiler warning with gcc -Wall:

ext_attr.c: In function ‘ext2fs_xattrs_read_inode’:
ext_attr.c:1000:16: warning: unused variable ‘i’ [-Wunused-variable]
1000 | size_t i;
| ^

You might as well remove the unnecessary newline at the top of the function.

But regardless, you can add.

Thanks!
-Lukas

Quoted 22 lines
Cc Andreas Dilger <[email protected]>
---
 lib/ext2fs/ext_attr.c | 1 -
 1 file changed, 1 deletion(-)
lib/ext2fs/ext_attr.c +0 -1
index d36fe68d..6fc4214c 100644
@@ -997,7 +997,6 @@ errcode_t ext2fs_xattrs_read_inode(struct ext2_xattr_handle *handle,
 	unsigned int storage_size;
 	char *start, *block_buf = NULL;
 	blk64_t blk;
-	size_t i;
 	errcode_t err = 0;
 
 	EXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EA_HANDLE);
Signature · 1 line
2.39.0