All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/6] powerpc: rework sparse for lib/xor_vmx.c
@ 2016-04-26 13:49 Daniel Axtens
  2016-04-26 22:18 ` Balbir Singh
  2016-04-28 14:22 ` [v2,1/6] " Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Axtens @ 2016-04-26 13:49 UTC (permalink / raw)
  To: linuxppc-dev, mpe; +Cc: andrew.donnellan, bsingharora, Daniel Axtens

Sparse doesn't seem to be passing -maltivec around properly, leading
to lots of errors:

.../include/altivec.h:34:2: error: Use the "-maltivec" flag to enable PowerPC AltiVec support
arch/powerpc/lib/xor_vmx.c:27:16: error: Expected ; at end of declaration
arch/powerpc/lib/xor_vmx.c:27:16: error: got signed
arch/powerpc/lib/xor_vmx.c:60:9: error: No right hand side of '*'-expression
arch/powerpc/lib/xor_vmx.c:60:9: error: Expected ; at end of statement
arch/powerpc/lib/xor_vmx.c:60:9: error: got v1_in
...
arch/powerpc/lib/xor_vmx.c:87:9: error: too many errors

Only include the altivec.h header for non-__CHECKER__ builds.
For builds with __CHECKER__, make up some stubs instead, as
suggested by Balbir. (The vector size of 16 is arbitrary.)

Suggested-by: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Daniel Axtens <dja@axtens.net>
---
This version works, which is - embarassingly - an improvement over
v1. I should test things better, sorry.
---
 arch/powerpc/lib/xor_vmx.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/powerpc/lib/xor_vmx.c b/arch/powerpc/lib/xor_vmx.c
index 07f49f1568e5..f9de69a04e88 100644
--- a/arch/powerpc/lib/xor_vmx.c
+++ b/arch/powerpc/lib/xor_vmx.c
@@ -17,7 +17,17 @@
  *
  * Author: Anton Blanchard <anton@au.ibm.com>
  */
+
+/*
+ * Sparse (as at v0.5.0) gets very, very confused by this file.
+ * Make it a bit simpler for it.
+ */
+#if !defined(__CHECKER__)
 #include <altivec.h>
+#else
+#define vec_xor(a, b) a ^ b
+#define vector __attribute__((vector_size(16)))
+#endif
 
 #include <linux/preempt.h>
 #include <linux/export.h>
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 1/6] powerpc: rework sparse for lib/xor_vmx.c
  2016-04-26 13:49 [PATCH v2 1/6] powerpc: rework sparse for lib/xor_vmx.c Daniel Axtens
@ 2016-04-26 22:18 ` Balbir Singh
  2016-04-28 14:22 ` [v2,1/6] " Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Balbir Singh @ 2016-04-26 22:18 UTC (permalink / raw)
  To: Daniel Axtens, linuxppc-dev, mpe; +Cc: andrew.donnellan



On 26/04/16 23:49, Daniel Axtens wrote:
> Sparse doesn't seem to be passing -maltivec around properly, leading
> to lots of errors:
> 
> .../include/altivec.h:34:2: error: Use the "-maltivec" flag to enable PowerPC AltiVec support
> arch/powerpc/lib/xor_vmx.c:27:16: error: Expected ; at end of declaration
> arch/powerpc/lib/xor_vmx.c:27:16: error: got signed
> arch/powerpc/lib/xor_vmx.c:60:9: error: No right hand side of '*'-expression
> arch/powerpc/lib/xor_vmx.c:60:9: error: Expected ; at end of statement
> arch/powerpc/lib/xor_vmx.c:60:9: error: got v1_in
> ...
> arch/powerpc/lib/xor_vmx.c:87:9: error: too many errors
> 
> Only include the altivec.h header for non-__CHECKER__ builds.
> For builds with __CHECKER__, make up some stubs instead, as
> suggested by Balbir. (The vector size of 16 is arbitrary.)
> 
> Suggested-by: Balbir Singh <bsingharora@gmail.com>
> Signed-off-by: Daniel Axtens <dja@axtens.net>
> ---
> This version works, which is - embarassingly - an improvement over
> v1. I should test things better, sorry.
> ---
>  arch/powerpc/lib/xor_vmx.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/powerpc/lib/xor_vmx.c b/arch/powerpc/lib/xor_vmx.c
> index 07f49f1568e5..f9de69a04e88 100644
> --- a/arch/powerpc/lib/xor_vmx.c
> +++ b/arch/powerpc/lib/xor_vmx.c
> @@ -17,7 +17,17 @@
>   *
>   * Author: Anton Blanchard <anton@au.ibm.com>
>   */
> +
> +/*
> + * Sparse (as at v0.5.0) gets very, very confused by this file.
> + * Make it a bit simpler for it.
> + */
> +#if !defined(__CHECKER__)
>  #include <altivec.h>
> +#else
> +#define vec_xor(a, b) a ^ b
> +#define vector __attribute__((vector_size(16)))
> +#endif
>  
>  #include <linux/preempt.h>
>  #include <linux/export.h>
> 

Yes, this worked for me

Tested-by: Balbir Singh <bsingharora@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [v2,1/6] powerpc: rework sparse for lib/xor_vmx.c
  2016-04-26 13:49 [PATCH v2 1/6] powerpc: rework sparse for lib/xor_vmx.c Daniel Axtens
  2016-04-26 22:18 ` Balbir Singh
@ 2016-04-28 14:22 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2016-04-28 14:22 UTC (permalink / raw)
  To: Daniel Axtens, linuxppc-dev; +Cc: andrew.donnellan, Daniel Axtens

On Tue, 2016-26-04 at 13:49:09 UTC, Daniel Axtens wrote:
> Sparse doesn't seem to be passing -maltivec around properly, leading
> to lots of errors:
...
> Only include the altivec.h header for non-__CHECKER__ builds.
> For builds with __CHECKER__, make up some stubs instead, as
> suggested by Balbir. (The vector size of 16 is arbitrary.)
> 
> Suggested-by: Balbir Singh <bsingharora@gmail.com>
> Signed-off-by: Daniel Axtens <dja@axtens.net>
> Tested-by: Balbir Singh <bsingharora@gmail.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/8fe088850f13eabf8197df5b0b

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-28 14:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-26 13:49 [PATCH v2 1/6] powerpc: rework sparse for lib/xor_vmx.c Daniel Axtens
2016-04-26 22:18 ` Balbir Singh
2016-04-28 14:22 ` [v2,1/6] " Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.