linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* sparse checking prevented by "net: fix kmemcheck annotations"
@ 2010-03-01 12:09 Stefan Richter
  2010-03-01 13:09 ` Eric Dumazet
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Richter @ 2010-03-01 12:09 UTC (permalink / raw)
  To: linux-kernel, Eric Dumazet; +Cc: David S. Miller, netdev

Hi all,

the post 2.6.32-rc5, pre 2.6.32-rc6 commit 14d18a81 causes a serious
regression for sparse checks:  make C=1 CF="-D__CHECK_ENDIAN__" now
causes sparse to log

    include/linux/skbuff.h:357:41: error: invalid bitfield specifier for
    type restricted __be16.


I reported this already shortly after this hit the mainline.  But back
then I didn't notice that this sparse error causes sparse to remain
silent on all subsequent warnings in a file!

We need to either change sparse to accept this bogus bit field that
occurs in skbuff.h (__be16 protocol:16;), silently or with a warning, or
revert this kmemcheck annotation.

("We" == preferably Eric :-)

skbuff.h is included by lots of drivers, even ones that are not even
networking drivers, notably DVB drivers.  None of these drivers can be
checked with sparse's __CHECK_ENDIAN__ at the moment.
-- 
Stefan Richter
-=====-==-=- --== ----=
http://arcgraph.de/sr/

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

* Re: sparse checking prevented by "net: fix kmemcheck annotations"
  2010-03-01 12:09 sparse checking prevented by "net: fix kmemcheck annotations" Stefan Richter
@ 2010-03-01 13:09 ` Eric Dumazet
  2010-03-01 16:18   ` Stefan Richter
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2010-03-01 13:09 UTC (permalink / raw)
  To: Stefan Richter; +Cc: linux-kernel, David S. Miller, netdev

Le lundi 01 mars 2010 à 13:09 +0100, Stefan Richter a écrit :
> Hi all,
> 
> the post 2.6.32-rc5, pre 2.6.32-rc6 commit 14d18a81 causes a serious
> regression for sparse checks:  make C=1 CF="-D__CHECK_ENDIAN__" now
> causes sparse to log
> 
>     include/linux/skbuff.h:357:41: error: invalid bitfield specifier for
>     type restricted __be16.
> 
> 
> I reported this already shortly after this hit the mainline.  But back
> then I didn't notice that this sparse error causes sparse to remain
> silent on all subsequent warnings in a file!
> 
> We need to either change sparse to accept this bogus bit field that
> occurs in skbuff.h (__be16 protocol:16;), silently or with a warning, or
> revert this kmemcheck annotation.
> 
> ("We" == preferably Eric :-)
> 
> skbuff.h is included by lots of drivers, even ones that are not even
> networking drivers, notably DVB drivers.  None of these drivers can be
> checked with sparse's __CHECK_ENDIAN__ at the moment.

Hi Stefan

I believe kmemcheck side effects were solved by commit e992cd9b72a18122
(kmemcheck: make bitfield annotations truly no-ops when disabled),
so there is no problem to partially revert the patch and fix this
problem.

Thanks !

[PATCH] net: fix protocol sk_buff field

Commit e992cd9b72a18 (kmemcheck: make bitfield annotations truly no-ops
when disabled) allows us to revert a workaround we did in the past to
not add holes in sk_buff structure.

This patch partially reverts commit 14d18a81b5171
(net: fix kmemcheck annotations) so that sparse doesnt complain:

include/linux/skbuff.h:357:41: error: invalid bitfield specifier for
type restricted __be16.

Reported-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index ae836fd..b40f56b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -354,8 +354,8 @@ struct sk_buff {
 				ipvs_property:1,
 				peeked:1,
 				nf_trace:1;
-	__be16			protocol:16;
 	kmemcheck_bitfield_end(flags1);
+	__be16			protocol;
 
 	void			(*destructor)(struct sk_buff *skb);
 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)



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

* Re: sparse checking prevented by "net: fix kmemcheck annotations"
  2010-03-01 13:09 ` Eric Dumazet
@ 2010-03-01 16:18   ` Stefan Richter
  2010-03-02  2:39     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Richter @ 2010-03-01 16:18 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: linux-kernel, David S. Miller, netdev

Eric Dumazet wrote:
> [PATCH] net: fix protocol sk_buff field
> 
> Commit e992cd9b72a18 (kmemcheck: make bitfield annotations truly no-ops
> when disabled) allows us to revert a workaround we did in the past to
> not add holes in sk_buff structure.
> 
> This patch partially reverts commit 14d18a81b5171
> (net: fix kmemcheck annotations) so that sparse doesnt complain:
> 
> include/linux/skbuff.h:357:41: error: invalid bitfield specifier for
> type restricted __be16.

Great, very appreciated.
-- 
Stefan Richter
-=====-==-=- --== ----=
http://arcgraph.de/sr/

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

* Re: sparse checking prevented by "net: fix kmemcheck annotations"
  2010-03-01 16:18   ` Stefan Richter
@ 2010-03-02  2:39     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-03-02  2:39 UTC (permalink / raw)
  To: stefanr; +Cc: eric.dumazet, linux-kernel, netdev

From: Stefan Richter <stefanr@s5r6.in-berlin.de>
Date: Mon, 01 Mar 2010 17:18:06 +0100

> Eric Dumazet wrote:
>> [PATCH] net: fix protocol sk_buff field
>> 
>> Commit e992cd9b72a18 (kmemcheck: make bitfield annotations truly no-ops
>> when disabled) allows us to revert a workaround we did in the past to
>> not add holes in sk_buff structure.
>> 
>> This patch partially reverts commit 14d18a81b5171
>> (net: fix kmemcheck annotations) so that sparse doesnt complain:
>> 
>> include/linux/skbuff.h:357:41: error: invalid bitfield specifier for
>> type restricted __be16.
> 
> Great, very appreciated.

Applied, thanks everyone.

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

end of thread, other threads:[~2010-03-02  2:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-01 12:09 sparse checking prevented by "net: fix kmemcheck annotations" Stefan Richter
2010-03-01 13:09 ` Eric Dumazet
2010-03-01 16:18   ` Stefan Richter
2010-03-02  2:39     ` David Miller

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).