[Concept,01/21] ext4l: Use div64.h instead of defining locally

Message ID 20260108185149.1995917-2-sjg@u-boot.org
State New
Headers
Series ext4l: Add Kconfig options to reduce binary size (part P) |

Commit Message

Simon Glass Jan. 8, 2026, 6:51 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

U-Boot has a do_div() macro which is supported on most boards. Use that
instead of defining a new one.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 fs/ext4l/ext4_uboot.h | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
  

Patch

diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h
index c013b9605a4..04b76af7f09 100644
--- a/fs/ext4l/ext4_uboot.h
+++ b/fs/ext4l/ext4_uboot.h
@@ -36,6 +36,7 @@ 
 #include <linux/seq_file.h>
 #include <linux/rbtree.h>	/* Real rbtree implementation */
 #include <u-boot/crc.h>		/* For crc32() used by crc32_be */
+#include <div64.h>
 
 /*
  * Enable ext4_msg() and other diagnostic macros to pass full messages.
@@ -439,15 +440,6 @@  int __ext4_xattr_set_credits(struct super_block *sb, struct inode *inode,
 #define sb_issue_zeroout(sb, blk, num, gfp)	({ (void)(sb); (void)(blk); (void)(num); (void)(gfp); 0; })
 #define blkdev_issue_flush(bdev)		({ (void)(bdev); 0; })
 
-/* do_div - divide u64 by u32 */
-#define do_div(n, base) ({			\
-	unsigned int __base = (base);		\
-	unsigned int __rem;			\
-	__rem = ((unsigned long long)(n)) % __base;	\
-	(n) = ((unsigned long long)(n)) / __base;	\
-	__rem;					\
-})
-
 /* Inode locking - stubs */
 #define inode_is_locked(i)	(1)
 #define i_size_write(i, s)	do { (i)->i_size = (s); } while (0)