linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: disable sparse for lib/xor_vmx.c
@ 2016-04-26  4:58 Daniel Axtens
  2016-04-26  6:42 ` Balbir Singh
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Axtens @ 2016-04-26  4:58 UTC (permalink / raw)
  To: linuxppc-dev, mpe; +Cc: andrew.donnellan, 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

Disable sparse checking for xor_vmx.c.

Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 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..eccf37db9512 100644
--- a/arch/powerpc/lib/xor_vmx.c
+++ b/arch/powerpc/lib/xor_vmx.c
@@ -17,6 +17,16 @@
  *
  * Author: Anton Blanchard <anton@au.ibm.com>
  */
+
+/*
+ * Sparse (as at v0.5.0) gets very, very confused by this file.
+ * Just disable it.
+ */
+#ifdef __CHECKER__
+#undef __CHECKER__
+#warning "Sparse checking disabled for this file"
+#endif
+
 #include <altivec.h>
 
 #include <linux/preempt.h>
-- 
2.5.0

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

* Re: [PATCH] powerpc: disable sparse for lib/xor_vmx.c
  2016-04-26  4:58 [PATCH] powerpc: disable sparse for lib/xor_vmx.c Daniel Axtens
@ 2016-04-26  6:42 ` Balbir Singh
  0 siblings, 0 replies; 2+ messages in thread
From: Balbir Singh @ 2016-04-26  6:42 UTC (permalink / raw)
  To: Daniel Axtens, linuxppc-dev, mpe; +Cc: andrew.donnellan



On 26/04/16 14:58, 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
> 
> Disable sparse checking for xor_vmx.c.
> 
> Signed-off-by: Daniel Axtens <dja@axtens.net>
> ---
>  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..eccf37db9512 100644
> --- a/arch/powerpc/lib/xor_vmx.c
> +++ b/arch/powerpc/lib/xor_vmx.c
> @@ -17,6 +17,16 @@
>   *
>   * Author: Anton Blanchard <anton@au.ibm.com>
>   */
> +
> +/*
> + * Sparse (as at v0.5.0) gets very, very confused by this file.
> + * Just disable it.
> + */
> +#ifdef __CHECKER__
> +#undef __CHECKER__
> +#warning "Sparse checking disabled for this file"
> +#endif
> +
>  #include <altivec.h>
>  

Isn't it better to do this

#if !defined(__CHECKER__)
#include <altivec.h>
#else
#define vec_xor(a, b) a ^ b
#endif

This will probably let to sparse check the rest of the file. I've not checked it, just recommending it.
See how it goes

>  #include <linux/preempt.h>
> 

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

end of thread, other threads:[~2016-04-26  6:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-26  4:58 [PATCH] powerpc: disable sparse for lib/xor_vmx.c Daniel Axtens
2016-04-26  6:42 ` Balbir Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).