From 7a7f7cc9c3ed7f614fb98df18f1c4035a36ce5d1 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Wed, 14 Dec 2011 23:59:11 +0100 Subject: [PATCH] * include/grub/kernel.h (FOR_MODULES): Make it a bit faster. --- ChangeLog | 4 ++++ include/grub/kernel.h | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb00e383e..ecc637e63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-12-14 Vladimir Serbinenko + + * include/grub/kernel.h (FOR_MODULES): Make it a bit faster. + 2011-12-14 Vladimir Serbinenko * include/grub/types.h (GRUB_PROPERLY_ALIGNED_ARRAY): Add missing diff --git a/include/grub/kernel.h b/include/grub/kernel.h index c9a549675..4c8b29c8b 100644 --- a/include/grub/kernel.h +++ b/include/grub/kernel.h @@ -71,15 +71,13 @@ struct grub_module_info64 extern grub_addr_t EXPORT_VAR (grub_modbase); -#define FOR_MODULES(var) for (var = grub_modbase ? (struct grub_module_header *) \ +#define FOR_MODULES(var) for (\ + var = grub_modbase ? (struct grub_module_header *) \ (grub_modbase + (((struct grub_module_info *) grub_modbase)->offset)) : 0;\ var && (grub_addr_t) var \ < (grub_modbase + (((struct grub_module_info *) grub_modbase)->size)); \ var = (struct grub_module_header *) \ - ((grub_uint32_t *) var \ - + ((((struct grub_module_header *) var)->size \ - + sizeof (grub_uint32_t) - 1) \ - / sizeof (grub_uint32_t)))) + ((grub_uint32_t *) var + ((struct grub_module_header *) var)->size / 4)) grub_addr_t grub_modules_get_end (void);