aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Charlebois <charlebm@gmail.com>2012-11-20 15:18:16 -0500
committerBehan Webster <behanw@converseincode.com>2014-06-07 14:44:39 -0400
commit66d8ea57284141bbeed01ee3250e23e8553dbca8 (patch)
tree38f979619d22b01477328b90799acbccb211ee01
parentd4c54919ed86302094c0ca7d48a8cbd4ee753e92 (diff)
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 <charlebm@gmail.com> Signed-off-by: Mark Charlebois <charlebm@gmail.com> Signed-off-by: Behan Webster <behanw@converseincode.com>
-rw-r--r--crypto/shash.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/shash.c b/crypto/shash.c
index 929058a68561..47c713954bf3 100644
--- a/crypto/shash.c
+++ b/crypto/shash.c
@@ -67,7 +67,8 @@ EXPORT_SYMBOL_GPL(crypto_shash_setkey);
67static inline unsigned int shash_align_buffer_size(unsigned len, 67static inline unsigned int shash_align_buffer_size(unsigned len,
68 unsigned long mask) 68 unsigned long mask)
69{ 69{
70 return len + (mask & ~(__alignof__(u8 __attribute__ ((aligned))) - 1)); 70 typedef u8 __attribute__ ((aligned)) u8_aligned;
71 return len + (mask & ~(__alignof__(u8_aligned) - 1));
71} 72}
72 73
73static int shash_update_unaligned(struct shash_desc *desc, const u8 *data, 74static int shash_update_unaligned(struct shash_desc *desc, const u8 *data,