[PATCH v3 03/10] ext4: Avoid expr in declaration in ext4fs_get_bgdtable()

Simon Glass sjg at chromium.org
Sat May 10 15:06:09 CEST 2025


Move the expression into the body of the function so the ordering can
be adjusted.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 fs/ext4/ext4_write.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/ext4_write.c b/fs/ext4/ext4_write.c
index d109ed6e90d..8e6179c4a99 100644
--- a/fs/ext4/ext4_write.c
+++ b/fs/ext4/ext4_write.c
@@ -108,7 +108,9 @@ int ext4fs_get_bgdtable(void)
 {
 	int status;
 	struct ext_filesystem *fs = get_fs();
-	int gdsize_total = ROUND(fs->no_blkgrp * fs->gdsize, fs->blksz);
+	int gdsize_total;
+
+	gdsize_total = ROUND(fs->no_blkgrp * fs->gdsize, fs->blksz);
 	fs->no_blk_pergdt = gdsize_total / fs->blksz;
 
 	/* allocate memory for gdtable */
-- 
2.43.0



More information about the U-Boot mailing list