Skip to content

Commit

Permalink
[PATCH] mac80211: fix printk warning on 64-bit
Browse files Browse the repository at this point in the history
My AID message patch introduced a warning on 64-bit machines because ~
extends to unsigned long:

| net/mac80211/ieee80211_sta.c: In function ‘ieee80211_rx_mgmt_assoc_resp’:
| net/mac80211/ieee80211_sta.c:1187: warning: format ‘%d’ expects type ‘int’, but argument 7 has type ‘long unsigned int’

This fixes it by explicitly casting the result to u16 (which 'aid' is).

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Oct 26, 2007
1 parent 31c7cec commit ddd6858
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/mac80211/ieee80211_sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev,
printk(KERN_DEBUG "%s: RX %sssocResp from %s (capab=0x%x "
"status=%d aid=%d)\n",
dev->name, reassoc ? "Rea" : "A", print_mac(mac, mgmt->sa),
capab_info, status_code, aid & ~(BIT(15) | BIT(14)));
capab_info, status_code, (u16)(aid & ~(BIT(15) | BIT(14))));

if (status_code != WLAN_STATUS_SUCCESS) {
printk(KERN_DEBUG "%s: AP denied association (code=%d)\n",
Expand Down

0 comments on commit ddd6858

Please sign in to comment.