From: Dmitry Torokhov Date: Fri, 4 Feb 2011 21:30:10 +0000 (-0800) Subject: module: explicitly align module_version_attribute structure X-Git-Tag: v2.6.38-rc6~3 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=98562ad8cb03fa6b7ba7f50168cdb34a98abcc1d;p=~shefty%2Frdma-dev.git module: explicitly align module_version_attribute structure We force particular alignment when we generate attribute structures when generation MODULE_VERSION() data and we need to make sure that this alignment is followed when we iterate over these structures, otherwise we may crash on platforms whose natural alignment is not sizeof(void *), such as m68k. Reported-by: Geert Uytterhoeven Signed-off-by: Dmitry Torokhov [ There are more issues here, but the fixes are incredibly ugly - Linus ] Signed-off-by: Linus Torvalds --- diff --git a/include/linux/module.h b/include/linux/module.h index 9bdf27c7615..5de42043dff 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -62,7 +62,7 @@ struct module_version_attribute { struct module_attribute mattr; const char *module_name; const char *version; -}; +} __attribute__ ((__aligned__(sizeof(void *)))); struct module_kobject {