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);