From: Mark Charlebois Date: Tue, 20 Nov 2012 20:18:16 +0000 (+0100) Subject: crypto: LLVMLinux: aligned-attribute.patch X-Git-Tag: v4.9.8~6303^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=66d8ea57284141bbeed01ee3250e23e8553dbca8;p=platform%2Fkernel%2Flinux-rpi3.git crypto: LLVMLinux: aligned-attribute.patch __attribute__((aligned)) applies the default alignment for the largest scalar type for the target ABI. gcc allows it to be applied inline to a defined type. Clang only allows it to be applied to a type definition (PR11071). Making it into 2 lines makes it more readable and works with both compilers. Author: Mark Charlebois Signed-off-by: Mark Charlebois Signed-off-by: Behan Webster --- diff --git a/crypto/shash.c b/crypto/shash.c index 929058a..47c7139 100644 --- a/crypto/shash.c +++ b/crypto/shash.c @@ -67,7 +67,8 @@ EXPORT_SYMBOL_GPL(crypto_shash_setkey); static inline unsigned int shash_align_buffer_size(unsigned len, unsigned long mask) { - return len + (mask & ~(__alignof__(u8 __attribute__ ((aligned))) - 1)); + typedef u8 __attribute__ ((aligned)) u8_aligned; + return len + (mask & ~(__alignof__(u8_aligned) - 1)); } static int shash_update_unaligned(struct shash_desc *desc, const u8 *data,