Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH -mm] mac80211: fix 1-bit bitfield to unsigned
@ 2007-06-06 22:02 Randy Dunlap
  2007-06-08  8:10 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2007-06-06 22:02 UTC (permalink / raw)
  To: linux-wireless; +Cc: akpm, jbenc, flamingice

From: Randy Dunlap <randy.dunlap@oracle.com>

Fix 17 of these pairs of sparse warnings since it's difficult for a 1-bit
bitfield to have both a value bit and a sign bit.

net/mac80211/sta_info.h:105:16: error: dubious bitfield without explicit `signed' or `unsigned'
net/mac80211/sta_info.h:107:15: error: dubious bitfield without explicit `signed' or `unsigned'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 net/mac80211/sta_info.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.22-rc4-mm1.orig/net/mac80211/sta_info.h
+++ linux-2.6.22-rc4-mm1/net/mac80211/sta_info.h
@@ -102,9 +102,9 @@ struct sta_info {
 #ifdef CONFIG_MAC80211_DEBUGFS
 	int debugfs_registered;
 #endif
-	int assoc_ap:1; /* whether this is an AP that we are
-			 * associated with as a client */
-	int dls_sta:1; /* whether this stations is a DLS peer of us */
+	unsigned int assoc_ap:1; /* whether this is an AP that we are
+				  * associated with as a client */
+	unsigned int dls_sta:1; /* whether this stations is a DLS peer of us */
 
 #define DLS_STATUS_OK		0
 #define DLS_STATUS_NOLINK	1

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

* Re: [PATCH -mm] mac80211: fix 1-bit bitfield to unsigned
  2007-06-06 22:02 [PATCH -mm] mac80211: fix 1-bit bitfield to unsigned Randy Dunlap
@ 2007-06-08  8:10 ` Johannes Berg
  2007-06-08  8:21   ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2007-06-08  8:10 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-wireless, akpm, jbenc, flamingice, Zhu Yi

[-- Attachment #1: Type: text/plain, Size: 505 bytes --]

Very interesting. We were wondering why the latest git tree doesn't show
tons of endianness warnings, but it appears that when sparse finds these
dubious bitfields it turns off all other warnings.

Zhu Yi, can you apply this patch to your tree and review your code and
the sparse output and stick le16_to_cpu()/le32_to_cpu() into the
appropriate places? A whole bunch of things there are endianness broken
and sparse probably only gives you an approximation of what errors there
are.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

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

* Re: [PATCH -mm] mac80211: fix 1-bit bitfield to unsigned
  2007-06-08  8:10 ` Johannes Berg
@ 2007-06-08  8:21   ` Johannes Berg
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2007-06-08  8:21 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-wireless, akpm, jbenc, flamingice, Zhu Yi

[-- Attachment #1: Type: text/plain, Size: 714 bytes --]

On Fri, 2007-06-08 at 10:10 +0200, Johannes Berg wrote:
> Very interesting. We were wondering why the latest git tree doesn't show
> tons of endianness warnings, but it appears that when sparse finds these
> dubious bitfields it turns off all other warnings.
> 
> Zhu Yi, can you apply this patch to your tree and review your code and
> the sparse output and stick le16_to_cpu()/le32_to_cpu() into the
> appropriate places? A whole bunch of things there are endianness broken
> and sparse probably only gives you an approximation of what errors there
> are.

Oh, forgot to mention you need to run
make C=2 CHECKFLAGS="-D__CHECK_ENDIAN__" M=net/mac80211/

(if you weren't aware already.)

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

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

end of thread, other threads:[~2007-06-08  8:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-06 22:02 [PATCH -mm] mac80211: fix 1-bit bitfield to unsigned Randy Dunlap
2007-06-08  8:10 ` Johannes Berg
2007-06-08  8:21   ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox