[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1395956497-22774-1-git-send-email-behanw@converseincode.com>
Date: Thu, 27 Mar 2014 14:41:37 -0700
From: behanw@...verseincode.com
To: herbert@...dor.apana.org.au, davem@...emloft.net
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
torvalds@...ux-foundation.org, dwmw2@...radead.org,
pageexec@...email.hu, Mark Charlebois <charlebm@...il.com>,
Behan Webster <behanw@...verseincode.com>,
Steven Rostedt <rostedt@...dmis.org>,
Jonathan Corbet <corbet@....net>
Subject: [PATCH] crypto: LLVMLinux: aligned-attribute.patch
From: Mark Charlebois <charlebm@...il.com>
__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@...il.com>
Signed-off-by: Mark Charlebois <charlebm@...il.com>
Signed-off-by: Behan Webster <behanw@...verseincode.com>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Jonathan Corbet <corbet@....net>
---
crypto/shash.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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,
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists