[PATCH] ext4: initialize ext4_allocation_request with {}

Vivek BalachandharTN posted 1 patch 6 days, 1 hour ago
fs/ext4/balloc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] ext4: initialize ext4_allocation_request with {}
Posted by Vivek BalachandharTN 6 days, 1 hour ago
Replace explicit memset() with struct initialization using = {} for
ext4_allocation_request. This simplifies the code and makes the
initialization clearer while preserving behavior.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 fs/ext4/balloc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 8040c731b3e4..21ea53346c55 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -737,10 +737,9 @@ ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
 				  ext4_fsblk_t goal, unsigned int flags,
 				  unsigned long *count, int *errp)
 {
-	struct ext4_allocation_request ar;
+	struct ext4_allocation_request ar = {};
 	ext4_fsblk_t ret;
 
-	memset(&ar, 0, sizeof(ar));
 	/* Fill with neighbour allocated blocks */
 	ar.inode = inode;
 	ar.goal = goal;
-- 
2.34.1