提交 1990ca61 编写于 作者: K Kalle Valo 提交者: John W. Linville

mac80211: fix a warning related to pointer conversion to u64 cookie

On a 32 bit system (in this case an omap 3430 system) gcc warned about
pointer conversion:

net/mac80211/work.c: In function 'ieee80211_remain_on_channel_timeout':
net/mac80211/work.c:534: warning: cast from pointer to integer of different size
net/mac80211/work.c: In function 'ieee80211_remain_done':
net/mac80211/work.c:1030: warning: cast from pointer to integer of different size
net/mac80211/work.c: In function 'ieee80211_wk_remain_on_channel':
net/mac80211/work.c:1056: warning: cast from pointer to integer of different size
net/mac80211/work.c: In function 'ieee80211_wk_cancel_remain_on_channel':
net/mac80211/work.c:1072: warning: cast from pointer to integer of different size

Fix it by casting the pointers to unsigned long instead. This makes the
compiler happy again.

Compile-tested only.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: NKalle Valo <kalle.valo@nokia.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 29401f66
...@@ -531,9 +531,9 @@ ieee80211_remain_on_channel_timeout(struct ieee80211_work *wk) ...@@ -531,9 +531,9 @@ ieee80211_remain_on_channel_timeout(struct ieee80211_work *wk)
wk->remain.started = true; wk->remain.started = true;
wk->timeout = jiffies + msecs_to_jiffies(wk->remain.duration); wk->timeout = jiffies + msecs_to_jiffies(wk->remain.duration);
cfg80211_ready_on_channel(wk->sdata->dev, (u64)wk, wk->chan, cfg80211_ready_on_channel(wk->sdata->dev, (unsigned long) wk,
wk->chan_type, wk->remain.duration, wk->chan, wk->chan_type,
GFP_KERNEL); wk->remain.duration, GFP_KERNEL);
return WORK_ACT_NONE; return WORK_ACT_NONE;
} }
...@@ -1027,7 +1027,7 @@ static enum work_done_result ieee80211_remain_done(struct ieee80211_work *wk, ...@@ -1027,7 +1027,7 @@ static enum work_done_result ieee80211_remain_done(struct ieee80211_work *wk,
/* /*
* We are done serving the remain-on-channel command. * We are done serving the remain-on-channel command.
*/ */
cfg80211_remain_on_channel_expired(wk->sdata->dev, (u64)wk, cfg80211_remain_on_channel_expired(wk->sdata->dev, (unsigned long) wk,
wk->chan, wk->chan_type, wk->chan, wk->chan_type,
GFP_KERNEL); GFP_KERNEL);
...@@ -1053,7 +1053,7 @@ int ieee80211_wk_remain_on_channel(struct ieee80211_sub_if_data *sdata, ...@@ -1053,7 +1053,7 @@ int ieee80211_wk_remain_on_channel(struct ieee80211_sub_if_data *sdata,
wk->remain.duration = duration; wk->remain.duration = duration;
*cookie = (u64)wk; *cookie = (unsigned long) wk;
ieee80211_add_work(wk); ieee80211_add_work(wk);
...@@ -1069,7 +1069,7 @@ int ieee80211_wk_cancel_remain_on_channel(struct ieee80211_sub_if_data *sdata, ...@@ -1069,7 +1069,7 @@ int ieee80211_wk_cancel_remain_on_channel(struct ieee80211_sub_if_data *sdata,
mutex_lock(&local->work_mtx); mutex_lock(&local->work_mtx);
list_for_each_entry_safe(wk, tmp, &local->work_list, list) { list_for_each_entry_safe(wk, tmp, &local->work_list, list) {
if ((u64)wk == cookie) { if ((unsigned long) wk == cookie) {
wk->timeout = jiffies; wk->timeout = jiffies;
found = true; found = true;
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册