From patchwork Fri Feb 26 12:46:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102665 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp695972lbc; Fri, 26 Feb 2016 04:47:24 -0800 (PST) X-Received: by 10.66.63.104 with SMTP id f8mr1724666pas.109.1456490843465; Fri, 26 Feb 2016 04:47:23 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kv12si3479273pab.194.2016.02.26.04.47.23 for ; Fri, 26 Feb 2016 04:47:23 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751777AbcBZMrW (ORCPT ); Fri, 26 Feb 2016 07:47:22 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:57244 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751488AbcBZMrV (ORCPT ); Fri, 26 Feb 2016 07:47:21 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue003) with ESMTPA (Nemesis) id 0MAReI-1akrZQ01LG-00Bbs5; Fri, 26 Feb 2016 13:46:42 +0100 From: Arnd Bergmann To: Herbert Xu Cc: linux-arm-kernel@lists.infradead.org, Dmitry Kasatkin , linux-crypto@vger.kernel.org, David Howells , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] lib/mpi: avoid assembler warning Date: Fri, 26 Feb 2016 13:46:26 +0100 Message-Id: <1456490794-1034544-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:e6YE+2Pu1xXZcp9Dh1HqlorAtBHTJiFwnqtyLoNYRTByBpf32km a6k1TQBfxTcu9sgrli0omVQ1bDLzvecgmHaqA0QC6HuBqg/aulySD2UzAGs2C4jLDz/+TDG IIfaXoPtXMl97kjHQmHAh8e8RPnbxwVNRsSPyVAkdjCsKShOsbujdkWVSr+IMWNC7VrFfDj dQIU6claYp9p6DT02CHfg== X-UI-Out-Filterresults: notjunk:1; V01:K0:PAUKSW9LSVw=:iatDNBgh9YbjYXpBwXZKai zrlzCn20rsgixxM8Vs/Kds94ZIN4vc47zRfbaAFXZgjUZX4/zGkm3E8SjUitFvtuhFBpL4bEL oX+IeCuWOWN7CM9WR6frerzLQeY+ujOaSSNrXGBiFg8rCtLSGldjGQPavojobc+iTwfG7H+Mg B3+PDhVPhjOLSmhUE5Up7CNiPgq9nslfxFVQCM7tKMNw7LP/WKMrAu9yyBjaggoZW7CoWAUtb gpHaFjLVidSujIhUovumzWxYFNePG5VRJo5Ruerno5a5aAfg2YkUv77MXHgBfmC50CH2gXEll Gzoa3pB8IBXj0F6uSH5z7Gk3ZZBl67MZPecOd6zasXJfLBA4xpVPOuXTvgzKmGPrDFChj4bER aeQ8BZ6Mxn/mS7jJ56a2sTCDm/Q75m6qW2uX6OUC13pZx+fEyzpgoZri6fdW2FWvCGnGYRhpt BfVpmHK2sq+/vn7Z35ZlYy3bzhKco17Yw9M8IhZxyddxxDYL3aMWx1Tnn1dD6YaK6Sa0eBq28 Ex/rR44rz0gnevOTHnsBrofKdkbHSIf4FfqEX3Izg52y8njFK4t+FDcV8lgV/6czX1qNmXSho 8mzPkFfWG2/mNW0aAhysUviB2un2ZRnHiuHw6mBzWCuxWTWcVGUPwUmadChSUX0RVRZIPh0ah lwAAM/I6maLMMwWQcAxI9WXgFkZybYtngJzMc0mibZ4Y9MPN3xBS4gUqm4Ys9caV/CVc= Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org A wrapper around the umull assembly instruction might reuse the input register as an output, which is undefined on some ARM machines, as pointed out by this assembler warning: CC lib/mpi/generic_mpih-mul1.o /tmp/ccxJuxIy.s: Assembler messages: /tmp/ccxJuxIy.s:53: rdhi, rdlo and rm must all be different CC lib/mpi/generic_mpih-mul2.o /tmp/ccI0scAD.s: Assembler messages: /tmp/ccI0scAD.s:53: rdhi, rdlo and rm must all be different CC lib/mpi/generic_mpih-mul3.o /tmp/ccMvVQcp.s: Assembler messages: /tmp/ccMvVQcp.s:53: rdhi, rdlo and rm must all be different This changes the constraints to force different registers to be used as output. Signed-off-by: Arnd Bergmann --- lib/mpi/longlong.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h index b90e255c2a68..93336502af08 100644 --- a/lib/mpi/longlong.h +++ b/lib/mpi/longlong.h @@ -216,7 +216,7 @@ extern UDItype __udiv_qrnnd(UDItype *, UDItype, UDItype, UDItype); __asm__ ("%@ Inlined umul_ppmm\n" \ "umull %r1, %r0, %r2, %r3" \ : "=&r" ((USItype)(xh)), \ - "=r" ((USItype)(xl)) \ + "=&r" ((USItype)(xl)) \ : "r" ((USItype)(a)), \ "r" ((USItype)(b)) \ : "r0", "r1") From patchwork Fri Feb 26 12:46:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102664 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp696124lbc; Fri, 26 Feb 2016 04:47:44 -0800 (PST) X-Received: by 10.66.244.233 with SMTP id xj9mr1755906pac.19.1456490864271; Fri, 26 Feb 2016 04:47:44 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fl1si2905544pad.15.2016.02.26.04.47.44 for ; Fri, 26 Feb 2016 04:47:44 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753957AbcBZMrh (ORCPT ); Fri, 26 Feb 2016 07:47:37 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:64601 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753959AbcBZMrg (ORCPT ); Fri, 26 Feb 2016 07:47:36 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue003) with ESMTPA (Nemesis) id 0M4mmf-1ZhkIK2AFZ-00yzZK; Fri, 26 Feb 2016 13:46:53 +0100 From: Arnd Bergmann To: Herbert Xu Cc: linux-arm-kernel@lists.infradead.org, Dmitry Kasatkin , linux-crypto@vger.kernel.org, David Howells , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] lib/mpi: use "static inline" instead of "extern inline" Date: Fri, 26 Feb 2016 13:46:27 +0100 Message-Id: <1456490794-1034544-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456490794-1034544-1-git-send-email-arnd@arndb.de> References: <1456490794-1034544-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:Y21+0uX/U+Vvm4r1pxCyU4qi9g9JRvce0k2/2Pi3mYY4Js0Up2p Eqglc3om4GRMNFHf2d/PODpXR6Lrs/UkeJLJZz/apNqjlgypWMuiM3HrTZE1/LFmgMB8ihQ 7X9vzsB6XJAo7ZLBX1GRPwrjcCANnYewDTOzx7xEmV8RMUF/+4aYo+NSGfbPmaqEdSM7/lf T0G/DLmiucupLetybyf4A== X-UI-Out-Filterresults: notjunk:1; V01:K0:k6ljiWo4Df4=:gNJSxOzzKHpEX0/2envsry I8nw5TQU8bos8Bd7Mq2oK02Ai4+HsxIda0xW+qyDo3Gcnkol2gVY7QjYw5WYtX5qPvjVy/Qf6 OvvCsR+e+1v+7TZhUEyvhnKFBWOwCpyM9qisB3fDvqpQCkgPyqtmQVnxi0dnFiuCndY/rXMWa I3WGcsW5KkHOUN7liHib6JhcEbDzecIAh83WZn4W2+aXYWgaOrho+Odm4gGnrs5xB8z2FCtlv 41gp+1OhHOexJjUaPYV9VFIYaxEyAXjjoZiSBiRHz50KjSok8crJGfFCdKYVyAQuFvlRYsiMA PRE9UXSEhv6qaGIGGCXX0hAVQ35sWWuU8q+rVF612/SmX9bWEyZ3DyvXBZjSblOCOolKYHUpK Z+SDJbknlPz/URaMaKKO6i7eA+SP7teMTo5clqHMPudNAQwy8Y7C7557oNMD6Rch3z1r1E5ot XDjoqpIc7N4xOz0UU1aFm3NwsBIKuYwGx2uMal4ADZHW6pCO5GX0BYvZUzR8zUjrji45eou9l JqrRkK19oJLbNXhc/2fAzGtytEpviaSBeCIhBz7CeAzcBv8Fd1pB6HM5UDVp3TFefi+OwSxn6 RiH7ZKdDbhhUoiyJoB+RwnBcPuVA4v/1CaIM+1y5/HJx7aTfUzVx1ZHalZsYZFBELq6xXVuXG Q5qwb0EfBi5gWdGYWM6fsGFosiV5ySksExsSnpEV3JN9fnkc7F6EGca7xepCZMvcKXYA= Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org When we use CONFIG_PROFILE_ALL_BRANCHES, every 'if()' introduces a static variable, but that is not allowed in 'extern inline' functions: mpi-inline.h:116:204: warning: '______f' is static but declared in inline function 'mpihelp_sub' which is not static mpi-inline.h:113:184: warning: '______f' is static but declared in inline function 'mpihelp_sub' which is not static mpi-inline.h:70:184: warning: '______f' is static but declared in inline function 'mpihelp_add' which is not static mpi-inline.h:56:204: warning: '______f' is static but declared in inline function 'mpihelp_add_1' which is not static This changes the MPI code to use 'static inline' instead, to get rid of hundreds of warnings. Signed-off-by: Arnd Bergmann --- lib/mpi/mpi-inline.h | 2 +- lib/mpi/mpi-internal.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/lib/mpi/mpi-inline.h b/lib/mpi/mpi-inline.h index e2b39852b30a..c245ea31f785 100644 --- a/lib/mpi/mpi-inline.h +++ b/lib/mpi/mpi-inline.h @@ -30,7 +30,7 @@ #define G10_MPI_INLINE_H #ifndef G10_MPI_INLINE_DECL -#define G10_MPI_INLINE_DECL extern inline +#define G10_MPI_INLINE_DECL static inline #endif G10_MPI_INLINE_DECL mpi_limb_t diff --git a/lib/mpi/mpi-internal.h b/lib/mpi/mpi-internal.h index c65dd1bff45a..7eceeddb3fb8 100644 --- a/lib/mpi/mpi-internal.h +++ b/lib/mpi/mpi-internal.h @@ -168,19 +168,19 @@ void mpi_rshift_limbs(MPI a, unsigned int count); int mpi_lshift_limbs(MPI a, unsigned int count); /*-- mpihelp-add.c --*/ -mpi_limb_t mpihelp_add_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, +static inline mpi_limb_t mpihelp_add_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, mpi_limb_t s2_limb); mpi_limb_t mpihelp_add_n(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_ptr_t s2_ptr, mpi_size_t size); -mpi_limb_t mpihelp_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, +static inline mpi_limb_t mpihelp_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, mpi_ptr_t s2_ptr, mpi_size_t s2_size); /*-- mpihelp-sub.c --*/ -mpi_limb_t mpihelp_sub_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, +static inline mpi_limb_t mpihelp_sub_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, mpi_limb_t s2_limb); mpi_limb_t mpihelp_sub_n(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_ptr_t s2_ptr, mpi_size_t size); -mpi_limb_t mpihelp_sub(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, +static inline mpi_limb_t mpihelp_sub(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, mpi_ptr_t s2_ptr, mpi_size_t s2_size); /*-- mpihelp-cmp.c --*/