[PATCH 21/21] MIPS: reloc: use IS_ALIGNED macro to check for an alignment

Denis Orlov denorl2009 at gmail.com
Mon Jul 24 22:05:22 PDT 2023


Improves the code readability a tiny little bit.

Signed-off-by: Denis Orlov <denorl2009 at gmail.com>
---
 arch/mips/lib/reloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/lib/reloc.c b/arch/mips/lib/reloc.c
index 83b4040d95..a9078aa813 100644
--- a/arch/mips/lib/reloc.c
+++ b/arch/mips/lib/reloc.c
@@ -133,7 +133,7 @@ void __noreturn relocate_code(void *fdt, u32 fdt_size, u32 ram_size)
 	 * space in the Barebox binary & complexity in handling them.
 	 */
 	off = relocaddr - (unsigned long)__image_start;
-	if (off & 0xffff)
+	if (!IS_ALIGNED(off, SZ_64K))
 		panic("Mis-aligned relocation\n");
 
 	/* Copy Barebox to RAM */
-- 
2.41.0




More information about the barebox mailing list