* [patch] sctp: dubious bitfields in sctp_transport
@ 2010-05-22 20:20 Dan Carpenter
2010-05-24 20:12 ` Vlad Yasevich
2010-05-26 7:40 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2010-05-22 20:20 UTC (permalink / raw)
To: Vlad Yasevich
Cc: Sridhar Samudrala, David S. Miller, Wei Yongjun, linux-sctp,
netdev, kernel-janitors
Sparse complains because these one-bit bitfields are signed.
include/net/sctp/structs.h:879:24: error: dubious one-bit signed bitfield
include/net/sctp/structs.h:889:31: error: dubious one-bit signed bitfield
include/net/sctp/structs.h:895:26: error: dubious one-bit signed bitfield
include/net/sctp/structs.h:898:31: error: dubious one-bit signed bitfield
include/net/sctp/structs.h:901:27: error: dubious one-bit signed bitfield
It doesn't cause a problem in the current code, but it would be better
to clean it up. This was introduced by c0058a35aacc7: "sctp: Save some
room in the sctp_transport by using bitfields".
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
It looks like this header is exported to user space. I don't know if
that makes a difference.
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 6173c61..4b86011 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -876,7 +876,7 @@ struct sctp_transport {
/* Reference counting. */
atomic_t refcnt;
- int dead:1,
+ __u32 dead:1,
/* RTO-Pending : A flag used to track if one of the DATA
* chunks sent to this address is currently being
* used to compute a RTT. If this flag is 0,
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [patch] sctp: dubious bitfields in sctp_transport
2010-05-22 20:20 [patch] sctp: dubious bitfields in sctp_transport Dan Carpenter
@ 2010-05-24 20:12 ` Vlad Yasevich
2010-05-26 7:40 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Vlad Yasevich @ 2010-05-24 20:12 UTC (permalink / raw)
To: Dan Carpenter
Cc: Sridhar Samudrala, David S. Miller, Wei Yongjun, linux-sctp,
netdev, kernel-janitors
Dan Carpenter wrote:
> Sparse complains because these one-bit bitfields are signed.
> include/net/sctp/structs.h:879:24: error: dubious one-bit signed bitfield
> include/net/sctp/structs.h:889:31: error: dubious one-bit signed bitfield
> include/net/sctp/structs.h:895:26: error: dubious one-bit signed bitfield
> include/net/sctp/structs.h:898:31: error: dubious one-bit signed bitfield
> include/net/sctp/structs.h:901:27: error: dubious one-bit signed bitfield
>
> It doesn't cause a problem in the current code, but it would be better
> to clean it up. This was introduced by c0058a35aacc7: "sctp: Save some
> room in the sctp_transport by using bitfields".
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
> It looks like this header is exported to user space. I don't know if
> that makes a difference.
That shouldn't make a difference.
-vlad
>
> diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
> index 6173c61..4b86011 100644
> --- a/include/net/sctp/structs.h
> +++ b/include/net/sctp/structs.h
> @@ -876,7 +876,7 @@ struct sctp_transport {
>
> /* Reference counting. */
> atomic_t refcnt;
> - int dead:1,
> + __u32 dead:1,
> /* RTO-Pending : A flag used to track if one of the DATA
> * chunks sent to this address is currently being
> * used to compute a RTT. If this flag is 0,
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] sctp: dubious bitfields in sctp_transport
2010-05-22 20:20 [patch] sctp: dubious bitfields in sctp_transport Dan Carpenter
2010-05-24 20:12 ` Vlad Yasevich
@ 2010-05-26 7:40 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2010-05-26 7:40 UTC (permalink / raw)
To: error27; +Cc: vladislav.yasevich, sri, yjwei, linux-sctp, netdev,
kernel-janitors
From: Dan Carpenter <error27@gmail.com>
Date: Sat, 22 May 2010 22:20:24 +0200
> Sparse complains because these one-bit bitfields are signed.
> include/net/sctp/structs.h:879:24: error: dubious one-bit signed bitfield
> include/net/sctp/structs.h:889:31: error: dubious one-bit signed bitfield
> include/net/sctp/structs.h:895:26: error: dubious one-bit signed bitfield
> include/net/sctp/structs.h:898:31: error: dubious one-bit signed bitfield
> include/net/sctp/structs.h:901:27: error: dubious one-bit signed bitfield
>
> It doesn't cause a problem in the current code, but it would be better
> to clean it up. This was introduced by c0058a35aacc7: "sctp: Save some
> room in the sctp_transport by using bitfields".
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Applied, thanks Dan.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-05-26 7:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-22 20:20 [patch] sctp: dubious bitfields in sctp_transport Dan Carpenter
2010-05-24 20:12 ` Vlad Yasevich
2010-05-26 7:40 ` 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).