diff options
author | Mark Charlebois <charlebm@gmail.com> | 2012-11-20 21:18:16 +0100 |
---|---|---|
committer | Behan Webster <behanw@converseincode.com> | 2014-06-07 11:44:39 -0700 |
commit | a30d8211457f944794833251615b7facd84b8ee3 (patch) | |
tree | 9cf1ad3ac0cddbc3799c808a4fe801e815f86b2a | |
parent | 6e3b70d7efc613e9444d3931f89c8586880a9181 (diff) | |
download | linux-crypto-a30d8211457f944794833251615b7facd84b8ee3.tar.gz linux-crypto-a30d8211457f944794833251615b7facd84b8ee3.zip |
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>
Diffstat (limited to '')
-rw-r--r-- | crypto/shash.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/shash.c b/crypto/shash.c index 929058a6..47c71395 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, |