netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: netdev@vger.kernel.org
Cc: Jouni Malinen <jkm@devicescape.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	Jiri Benc <jbenc@suse.cz>,
	Johannes Berg <johannes@sipsolutions.net>
Subject: [PATCH 12/18] d80211:  fix some sparse warnings
Date: Mon, 21 Aug 2006 09:41:19 +0200	[thread overview]
Message-ID: <20060821075201.370802472@sipsolutions.net> (raw)
In-Reply-To: 20060821074107.648561364@sipsolutions.net

[-- Attachment #1: d80211-sparse.patch --]
[-- Type: text/plain, Size: 9192 bytes --]

This patch fixes some warnings from sparse in d80211. Also
fixes indentation in places near where the changes were.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

--- wireless-dev.orig/include/net/d80211.h	2006-08-20 17:21:26.778192788 +0200
+++ wireless-dev/include/net/d80211.h	2006-08-20 17:21:27.318192788 +0200
@@ -246,10 +246,10 @@ struct ieee80211_conf {
 
 	/* Bitfields, grouped together */
 
-	int sw_encrypt:1;
-	int sw_decrypt:1;
-	int short_slot_time:1;		/* use IEEE 802.11g Short Slot Time */
-        int ssid_hidden:1;		/* do not broadcast the ssid */
+	unsigned int sw_encrypt:1;
+	unsigned int sw_decrypt:1;
+	unsigned int short_slot_time:1;	/* use IEEE 802.11g Short Slot Time */
+	unsigned int ssid_hidden:1;	/* do not broadcast the ssid */
 
         u8 power_level;			/* transmit power limit for current
 					 * regulatory domain; in dBm */
@@ -376,13 +376,13 @@ struct ieee80211_key_conf {
 	ieee80211_key_alg alg;
 	int keylen;
 
-        int force_sw_encrypt:1;		/* to be cleared by low-level driver */
+	unsigned int force_sw_encrypt:1;/* to be cleared by low-level driver */
 	int keyidx:8;			/* WEP key index */
-	int default_tx_key:1;		/* This key is the new default TX key
+	unsigned int default_tx_key:1;	/* This key is the new default TX key
 			       		 * (used only for broadcast keys). */
-	int default_wep_only:1; /* static WEP is the only configured security
-				 * policy; this allows some low-level drivers
-				 * to determine when hwaccel can be used */
+	unsigned int default_wep_only:1;/* static WEP is the only configured security
+					 * policy; this allows some low-level drivers
+					 * to determine when hwaccel can be used */
         u8 key[0];
 };
 
@@ -441,20 +441,20 @@ struct ieee80211_hw {
 	 * configure upper layer IEEE 802.11 module to generate beacons. The
 	 * low-level driver can use ieee80211_beacon_get() to fetch next
 	 * beacon frame. */
-	int host_gen_beacon:1;
+	unsigned int host_gen_beacon:1;
 
 	/* The device needs to be supplied with a beacon template only. */
-	int host_gen_beacon_template:1;
+	unsigned int host_gen_beacon_template:1;
 
 	/* Some devices handle decryption internally and do not
 	 * indicate whether the frame was encrypted (unencrypted frames
 	 * will be dropped by the hardware, unless specifically allowed
 	 * through) */
-        int device_hides_wep:1;
+	unsigned int device_hides_wep:1;
 
 	/* Whether RX frames passed to ieee80211_rx() include FCS in the end
 	 */
-	int rx_includes_fcs:1;
+	unsigned int rx_includes_fcs:1;
 
 	/* Some wireless LAN chipsets buffer broadcast/multicast frames for
 	 * power saving stations in the hardware/firmware and others rely on
@@ -462,19 +462,19 @@ struct ieee80211_hw {
 	 * configure upper layer IEEE 802.11 to buffer broadcast/multicast
 	 * frames when there are power saving stations so that low-level driver
 	 * can fetch them with ieee80211_get_buffered_bc(). */
-	int host_broadcast_ps_buffering:1;
+	unsigned int host_broadcast_ps_buffering:1;
 
-	int wep_include_iv:1;
-	int data_nullfunc_ack:1; /* will data nullfunc frames get proper
-                                  * TX status callback */
+	unsigned int wep_include_iv:1;
+	unsigned int data_nullfunc_ack:1; /* will data nullfunc frames get proper
+					   * TX status callback */
 
 	/* Force sw version of encryption for TKIP packets if WMM is enabled.
 	 */
-	int no_tkip_wmm_hwaccel:1;
+	unsigned int no_tkip_wmm_hwaccel:1;
 
         /* 1 if the payload needs to be padded at even boundaries after the
 	 * header */
-        unsigned int extra_hdr_room:1;
+	unsigned int extra_hdr_room:1;
 
 	/* Some devices handle Michael MIC internally and do not include MIC in
 	 * the received packets given to 80211.o. device_strips_mic must be set
--- wireless-dev.orig/net/d80211/ieee80211.c	2006-08-20 17:21:27.278192788 +0200
+++ wireless-dev/net/d80211/ieee80211.c	2006-08-20 20:13:29.932819787 +0200
@@ -229,7 +229,7 @@ static void ieee80211_key_threshold_noti
 
 	key->tx_rx_count = 0;
 
-	ieee80211_rx_mgmt(dev, skb, 0,
+	ieee80211_rx_mgmt(dev, skb, NULL,
 			  ieee80211_msg_key_threshold_notification);
 }
 
@@ -2636,7 +2636,7 @@ int ieee80211_radar_status(struct net_de
 	msg->radar = radar;
 	msg->radar_type = radar_type;
 
-	ieee80211_rx_mgmt(dev, skb, 0, ieee80211_msg_radar);
+	ieee80211_rx_mgmt(dev, skb, NULL, ieee80211_msg_radar);
 	return 0;
 }
 EXPORT_SYMBOL(ieee80211_radar_status);
@@ -2645,8 +2645,8 @@ EXPORT_SYMBOL(ieee80211_radar_status);
 int ieee80211_set_aid_for_sta(struct net_device *dev, u8 *peer_address,
 			      u16 aid)
 {
-        struct sk_buff *skb;
-        struct ieee80211_msg_set_aid_for_sta *msg;
+	struct sk_buff *skb;
+	struct ieee80211_msg_set_aid_for_sta *msg;
 
 	skb = dev_alloc_skb(sizeof(struct ieee80211_frame_info) +
 			    sizeof(struct ieee80211_msg_set_aid_for_sta));
@@ -2655,13 +2655,13 @@ int ieee80211_set_aid_for_sta(struct net
 		return -ENOMEM;
 	skb_reserve(skb, sizeof(struct ieee80211_frame_info));
 
-        msg = (struct ieee80211_msg_set_aid_for_sta *)
+	msg = (struct ieee80211_msg_set_aid_for_sta *)
 		skb_put(skb, sizeof(struct ieee80211_msg_set_aid_for_sta));
 	memcpy(msg->sta_address, peer_address, ETH_ALEN);
-        msg->aid = aid;
+	msg->aid = aid;
 
-        ieee80211_rx_mgmt(dev, skb, 0, ieee80211_msg_set_aid_for_sta);
-        return 0;
+	ieee80211_rx_mgmt(dev, skb, NULL, ieee80211_msg_set_aid_for_sta);
+	return 0;
 }
 EXPORT_SYMBOL(ieee80211_set_aid_for_sta);
 
--- wireless-dev.orig/net/d80211/ieee80211_i.h	2006-08-20 17:21:27.088192788 +0200
+++ wireless-dev/net/d80211/ieee80211_i.h	2006-08-20 20:13:30.362819787 +0200
@@ -115,10 +115,10 @@ struct ieee80211_txrx_data {
 	union {
 		struct {
 			struct ieee80211_tx_control *control;
-			int unicast:1;
-			int ps_buffered:1;
-			int short_preamble:1;
-			int probe_last_frag:1;
+			unsigned int unicast:1;
+			unsigned int ps_buffered:1;
+			unsigned int short_preamble:1;
+			unsigned int probe_last_frag:1;
 			struct ieee80211_rate *rate;
 			/* use this rate (if set) for last fragment; rate can
 			 * be set to lower rate for the first fragments, e.g.,
@@ -138,10 +138,10 @@ struct ieee80211_txrx_data {
 			int sent_ps_buffered;
 			int queue;
 			int load;
-			int in_scan:1;
-			int ra_match:1; /* frame is destined to interface
-					 * currently processed (including
-					 * multicast frames) */
+			unsigned int in_scan:1;
+			/* frame is destined to interface currently processed
+			 * (including multicast frames) */
+			unsigned int ra_match:1;
 		} rx;
 	} u;
 #ifdef CONFIG_HOSTAPD_WPA_TESTING
@@ -255,16 +255,16 @@ struct ieee80211_if_sta {
 
 	int auth_tries, assoc_tries;
 
-	int ssid_set:1;
-	int bssid_set:1;
-	int prev_bssid_set:1;
-	int authenticated:1;
-	int associated:1;
-	int probereq_poll:1;
-	int use_protection:1;
-	int create_ibss:1;
-	int mixed_cell:1;
-	int wmm_enabled:1;
+	unsigned int ssid_set:1;
+	unsigned int bssid_set:1;
+	unsigned int prev_bssid_set:1;
+	unsigned int authenticated:1;
+	unsigned int associated:1;
+	unsigned int probereq_poll:1;
+	unsigned int use_protection:1;
+	unsigned int create_ibss:1;
+	unsigned int mixed_cell:1;
+	unsigned int wmm_enabled:1;
 
 	int key_mgmt;
 	unsigned long last_probe;
@@ -293,8 +293,8 @@ struct ieee80211_sub_if_data {
         struct ieee80211_local *local;
 
 	int mc_count;
-	unsigned allmulti:1;
-	unsigned promisc:1;
+	unsigned int allmulti:1;
+	unsigned int promisc:1;
 
         struct net_device_stats stats;
 	int drop_unencrypted;
--- wireless-dev.orig/net/d80211/ieee80211_key.h	2006-08-20 17:21:27.238192788 +0200
+++ wireless-dev/net/d80211/ieee80211_key.h	2006-08-20 17:21:27.328192788 +0200
@@ -77,10 +77,10 @@ struct ieee80211_key {
 
 	/* if the low level driver can provide hardware acceleration it should
 	 * clear this flag */
-	int force_sw_encrypt:1;
+	unsigned int force_sw_encrypt:1;
 	int keyidx:8; /* WEP key index */
-	int default_tx_key:1; /* This key is the new default TX key
-			       * (used only for broadcast keys). */
+	unsigned int default_tx_key:1; /* This key is the new default TX key
+					* (used only for broadcast keys). */
 
 	u8 key[0];
 };
--- wireless-dev.orig/net/d80211/rate_control_simple.c	2006-08-20 17:21:27.228192788 +0200
+++ wireless-dev/net/d80211/rate_control_simple.c	2006-08-20 20:13:30.172819787 +0200
@@ -363,7 +363,7 @@ static struct rate_control_ops rate_cont
 	.remove_sta_attrs = rate_control_simple_remove_sta_attrs,
 };
 
-int __init rate_control_simple_init(void)
+static int __init rate_control_simple_init(void)
 {
 	return ieee80211_rate_control_register(&rate_control_simple);
 }
--- wireless-dev.orig/net/d80211/sta_info.h	2006-08-20 17:21:27.238192788 +0200
+++ wireless-dev/net/d80211/sta_info.h	2006-08-20 17:36:57.728192788 +0200
@@ -94,9 +94,9 @@ struct sta_info {
 				  * filtering; used only if sta->key is not
 				  * set */
 
-	int sysfs_registered:1;
-	int assoc_ap:1; /* whether this is an AP that we are associated with
-			 * as a client */
+	unsigned int sysfs_registered:1;
+	unsigned int assoc_ap:1; /* whether this is an AP that we are
+				  * associated with as a client */
 
 #ifdef CONFIG_HOSTAPD_WPA_TESTING
 	u32 wpa_trigger;

--

  parent reply	other threads:[~2006-08-21  8:02 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-21  7:41 [PATCH 00/18] d80211: various cleanups/fixes/changes Johannes Berg
2006-08-21  7:41 ` [PATCH 01/18] d80211: LED triggers Johannes Berg
2006-08-22  0:30   ` [PATCH 01/3] d80211: add support for SIOCSIWRATE, SIOCSIWTXPOW and SIOCSIWPOWER Mohamed Abbas
2006-08-22  0:36     ` [PATCH 02/3] d80211: iwlist scan Mohamed Abbas
2006-08-23 15:46       ` Jiri Benc
2006-08-28 20:37         ` [PATCH 0/7] d80211: support more wireless command mabbas
2006-08-22  0:38     ` [PATCH 03/3] d80211: adhoc Mohamed Abbas
2006-08-23 15:51       ` Jiri Benc
2006-08-23 15:19     ` [PATCH 01/3] d80211: add support for SIOCSIWRATE, SIOCSIWTXPOW and SIOCSIWPOWER Jiri Benc
2006-08-25 18:37     ` Jouni Malinen
2006-08-25 18:46       ` Mohamed Abbas
2006-08-22 16:54   ` [PATCH 01/18] d80211: LED triggers Jouni Malinen
2006-08-22 18:38     ` Jiri Benc
2006-08-23  7:02     ` Johannes Berg
2006-08-23 18:16   ` Jiri Benc
2006-08-24  7:03     ` Johannes Berg
2006-09-22 11:59   ` Jiri Benc
2006-08-21  7:41 ` [PATCH 02/18] d80211: master link Johannes Berg
2006-08-21  8:13   ` Johannes Berg
2006-08-21 19:08   ` Jiri Benc
2006-08-22  7:49     ` Johannes Berg
2006-08-21  7:41 ` [PATCH 03/18] d80211: pointers as extended booleans Johannes Berg
2006-08-22  6:43   ` Bill Fink
2006-08-22  8:39     ` Johannes Berg
2006-08-21  7:41 ` [PATCH 04/18] d80211: use kzalloc() Johannes Berg
2006-08-21  7:41 ` [PATCH 05/18] d80211: get rid of WME bitfield Johannes Berg
2006-08-21  7:41 ` [PATCH 06/18] d80211: rework rate control registration Johannes Berg
2006-08-21 19:19   ` Jiri Benc
2006-08-22  8:33     ` Johannes Berg
2006-08-21  7:41 ` [PATCH 07/18] d80211: get rid of sta_aid in favour of keeping track of TIM Johannes Berg
2006-08-22 18:36   ` Jiri Benc
2006-08-23  7:04     ` Johannes Berg
2006-08-23 10:04     ` [PATCH] " Johannes Berg
2006-08-23 10:05       ` Johannes Berg
2006-08-23 10:16     ` [PATCH ] " Johannes Berg
2006-08-21  7:41 ` [PATCH 08/18] d80211: clean up exports Johannes Berg
2006-08-22 16:44   ` Jouni Malinen
2006-08-23  7:01     ` Johannes Berg
2006-08-23 10:03     ` [PATCH] " Johannes Berg
2006-08-21  7:41 ` [PATCH 09/18] d80211: move out rate control registration code Johannes Berg
2006-08-21  7:41 ` [PATCH 10/18] d80211: clean up includes Johannes Berg
2006-08-21  7:41 ` [PATCH 11/18] d80211: clean up qdisc requeue Johannes Berg
2006-08-21 19:31   ` Jiri Benc
2006-08-22  7:48     ` Johannes Berg
2006-08-21  7:41 ` Johannes Berg [this message]
2006-08-22 18:55   ` [PATCH 12/18] d80211: fix some sparse warnings Jiri Benc
2006-08-21  7:41 ` [PATCH 13/18] d80211: clean up some coding style issues Johannes Berg
2006-08-21 19:35   ` Jiri Benc
2006-08-22  8:27     ` Johannes Berg
2006-08-21  7:41 ` [PATCH 14/18] d80211: make lowlevel TX framedump option visible Johannes Berg
2006-08-21  7:41 ` [PATCH 15/18] d80211: surface IBSS debug Johannes Berg
2006-08-21  7:41 ` [PATCH 16/18] d80211: get rid of MICHAEL_MIC_HWACCEL define Johannes Berg
2006-08-22 19:00   ` Jiri Benc
2006-08-23  7:05     ` Johannes Berg
2006-08-23  9:46       ` Jiri Benc
2006-08-21  7:41 ` [PATCH 17/18] d80211: surface powersave debug switch Johannes Berg
2006-08-21  7:41 ` [PATCH 18/18] d80211: fix some documentation Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060821075201.370802472@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=jbenc@suse.cz \
    --cc=jkm@devicescape.com \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).