* slab.h debugging tags....
@ 2015-10-09 0:12 Valdis Kletnieks
2015-10-09 19:40 ` Rasmus Villemoes
0 siblings, 1 reply; 3+ messages in thread
From: Valdis Kletnieks @ 2015-10-09 0:12 UTC (permalink / raw)
To: Rasmus Villemoes, Christoph Lameter; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 913 bytes --]
Author: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Date: Wed Oct 7 15:09:20 2015 +1100
slab.h: sprinkle __assume_aligned attributes
causes *tons* of whinges if you do 'make C=2' with sparse 0.5.0:
CHECK drivers/media/usb/pwc/pwc-if.c
include/linux/slab.h:307:43: error: attribute '__assume_aligned__': unknown attribute
include/linux/slab.h:308:58: error: attribute '__assume_aligned__': unknown attribute
include/linux/slab.h:337:73: error: attribute '__assume_aligned__': unknown attribute
include/linux/slab.h:375:74: error: attribute '__assume_aligned__': unknown attribute
include/linux/slab.h:378:80: error: attribute '__assume_aligned__': unknown attribute
[/usr/src/linux-next] grep CHECK build.default | wc
1779 3558 59132
[/usr/src/linux-next] grep slab.h build.default | wc
7225 43350 621350
Canned it after about 1/3 of the build.
Where's a sparse that can handle this?
[-- Attachment #2: Type: application/pgp-signature, Size: 848 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: slab.h debugging tags....
2015-10-09 0:12 slab.h debugging tags Valdis Kletnieks
@ 2015-10-09 19:40 ` Rasmus Villemoes
2015-10-10 18:34 ` Valdis.Kletnieks
0 siblings, 1 reply; 3+ messages in thread
From: Rasmus Villemoes @ 2015-10-09 19:40 UTC (permalink / raw)
To: Valdis Kletnieks; +Cc: Christoph Lameter, linux-kernel, Andrew Morton
On Fri, Oct 09 2015, Valdis Kletnieks <Valdis.Kletnieks@vt.edu> wrote:
> Author: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> Date: Wed Oct 7 15:09:20 2015 +1100
>
> slab.h: sprinkle __assume_aligned attributes
>
> causes *tons* of whinges if you do 'make C=2' with sparse 0.5.0:
>
> CHECK drivers/media/usb/pwc/pwc-if.c
> include/linux/slab.h:307:43: error: attribute '__assume_aligned__': unknown attribute
> include/linux/slab.h:308:58: error: attribute '__assume_aligned__': unknown attribute
> include/linux/slab.h:337:73: error: attribute '__assume_aligned__': unknown attribute
> include/linux/slab.h:375:74: error: attribute '__assume_aligned__': unknown attribute
> include/linux/slab.h:378:80: error: attribute '__assume_aligned__': unknown attribute
>
> [/usr/src/linux-next] grep CHECK build.default | wc
> 1779 3558 59132
> [/usr/src/linux-next] grep slab.h build.default | wc
> 7225 43350 621350
>
> Canned it after about 1/3 of the build.
>
> Where's a sparse that can handle this?
I don't think there is any (sparse 0.5 seems to be the latest). Hm,
if I'm reading the sparse source correctly, it is pretending to be
whatever gcc version it itself is built with. That's... um... let's just
say odd.
Does this fix it for you?
Subject: [PATCH] slab.h: hide assume_aligned attribute from sparse
sparse apparently pretends to be gcc >= 4.9, yet isn't prepared to
handle all the function attributes supported by those gccs and
complains loudly. So hide the definition of __assume_aligned from it
(so that the generic one in compiler.h gets used).
Reported-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
include/linux/compiler-gcc.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 18606a460baf..dc13ceeef8c8 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -211,7 +211,7 @@
#endif
-#if GCC_VERSION >= 40900
+#if GCC_VERSION >= 40900 && !defined(__CHECKER__)
/*
* __assume_aligned(n, k): Tell the optimizer that the returned
* pointer can be assumed to be k modulo n. The second argument is
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: slab.h debugging tags....
2015-10-09 19:40 ` Rasmus Villemoes
@ 2015-10-10 18:34 ` Valdis.Kletnieks
0 siblings, 0 replies; 3+ messages in thread
From: Valdis.Kletnieks @ 2015-10-10 18:34 UTC (permalink / raw)
To: Rasmus Villemoes; +Cc: Christoph Lameter, linux-kernel, Andrew Morton
[-- Attachment #1: Type: text/plain, Size: 1038 bytes --]
On Fri, 09 Oct 2015 21:40:33 +0200, Rasmus Villemoes said:
> Does this fix it for you?
>
> Subject: [PATCH] slab.h: hide assume_aligned attribute from sparse
>
> sparse apparently pretends to be gcc >= 4.9, yet isn't prepared to
Much better - it threw messages on a few files, it took me a moment to figure
out what happened.
CHECK init/do_mounts_initrd.c
init/do_mounts_initrd.c:8:2: warning: "Sparse checking disabled for this file"
include/linux/slab.h:307:43: error: attribute '__assume_aligned__': unknown attribute
include/linux/slab.h:308:58: error: attribute '__assume_aligned__': unknown attribute
include/linux/slab.h:337:73: error: attribute '__assume_aligned__': unknown attribute
include/linux/slab.h:375:74: error: attribute '__assume_aligned__': unknown attribute
include/linux/slab.h:378:80: error: attribute '__assume_aligned__': unknown attribute
but there's only like a few that disable sparse. Everything else behaves now.
Feel free to stick this on it:
Tested-By: Valdis Kletnieks <valdis.kletnieks@vt.edu>
[-- Attachment #2: Type: application/pgp-signature, Size: 848 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-10 18:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-09 0:12 slab.h debugging tags Valdis Kletnieks
2015-10-09 19:40 ` Rasmus Villemoes
2015-10-10 18:34 ` Valdis.Kletnieks
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®