From patchwork Thu Mar 27 21:41:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 27239 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f72.google.com (mail-pb0-f72.google.com [209.85.160.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 404D2202FA for ; Thu, 27 Mar 2014 21:42:25 +0000 (UTC) Received: by mail-pb0-f72.google.com with SMTP id jt11sf9896016pbb.7 for ; Thu, 27 Mar 2014 14:42:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=2g3NhzDq5NkQFaIjR61ZMJpGcVhv/kjwq6ZKoVpETR8=; b=cDRfFX+MeWFTqVLJFukJMwqqtgshwUyMFmbBR6WmNvwkXrVPJW6F+adXAFQwY6Dd6N Sp1/bhDhe1i4NjC+Rzrzn59mA4FgIVUFMoZ6UnAWiUjjhqbeeNaagzDR7Il2LUl5Fvk9 CK5tzCp9g+MqA6vrOs2XKx5jT6m2IVKohdZ5TbulJx0Vg2sOcMe8DnNTf/z8csp84vIa cxXuFYkJvawat/SSnGI0+R2LISnwPhObsgWvcTkqlErHLWwvY2nKdXKneG7QYnITaYaX BQf26HkspdCfxT+nlVd0lA/ZWYAxmjNR4H0fvd5QydBTTu/ckuw8wSWQCg2KOe2zseUu mS0A== X-Gm-Message-State: ALoCoQngs9NwP9N+s+/a6sn8aIxapm3SxeZSl1eLZL5MpVq+lcxnFNvM4YlTwfjeYRoxnnWTQxud X-Received: by 10.66.141.231 with SMTP id rr7mr470440pab.47.1395956544270; Thu, 27 Mar 2014 14:42:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.75 with SMTP id 69ls1326108qgm.94.gmail; Thu, 27 Mar 2014 14:42:24 -0700 (PDT) X-Received: by 10.220.106.84 with SMTP id w20mr3535568vco.18.1395956544061; Thu, 27 Mar 2014 14:42:24 -0700 (PDT) Received: from mail-ve0-x22f.google.com (mail-ve0-x22f.google.com [2607:f8b0:400c:c01::22f]) by mx.google.com with ESMTPS id sj4si880265vdc.30.2014.03.27.14.42.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Mar 2014 14:42:23 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22f; Received: by mail-ve0-f175.google.com with SMTP id oz11so4820019veb.6 for ; Thu, 27 Mar 2014 14:42:23 -0700 (PDT) X-Received: by 10.52.251.199 with SMTP id zm7mr2969615vdc.21.1395956543859; Thu, 27 Mar 2014 14:42:23 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp61488vck; Thu, 27 Mar 2014 14:42:23 -0700 (PDT) X-Received: by 10.68.136.162 with SMTP id qb2mr4408519pbb.88.1395956543123; Thu, 27 Mar 2014 14:42:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vu10si2345622pbc.267.2014.03.27.14.42.22; Thu, 27 Mar 2014 14:42:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757228AbaC0VmV (ORCPT + 1 other); Thu, 27 Mar 2014 17:42:21 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:55430 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757089AbaC0VmU (ORCPT ); Thu, 27 Mar 2014 17:42:20 -0400 Received: by mail-pd0-f169.google.com with SMTP id fp1so3938604pdb.28 for ; Thu, 27 Mar 2014 14:42:19 -0700 (PDT) X-Received: by 10.66.250.202 with SMTP id ze10mr4270830pac.153.1395956539494; Thu, 27 Mar 2014 14:42:19 -0700 (PDT) Received: from galdor.msi.event ([12.232.193.53]) by mx.google.com with ESMTPSA id pv4sm13617906pbb.55.2014.03.27.14.42.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Mar 2014 14:42:11 -0700 (PDT) From: behanw@converseincode.com To: herbert@gondor.apana.org.au, davem@davemloft.net Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, dwmw2@infradead.org, pageexec@freemail.hu, Mark Charlebois , Behan Webster , Steven Rostedt , Jonathan Corbet Subject: [PATCH] crypto: LLVMLinux: aligned-attribute.patch Date: Thu, 27 Mar 2014 14:41:37 -0700 Message-Id: <1395956497-22774-1-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.8.3.2 Sender: linux-crypto-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Original-Sender: behanw@converseincode.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (no key for signature) header.i=@converseincode.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mark Charlebois __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 Cc: Steven Rostedt Cc: Jonathan Corbet --- 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,