* [PATCH 1/3] mac80211: remove uneeded scan_chan variable
@ 2011-11-03 9:40 Stanislaw Gruszka
2011-11-03 9:40 ` [PATCH 2/3] mac80211: remove useless brackets in ieee80211_cfg_on_oper_channel Stanislaw Gruszka
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Stanislaw Gruszka @ 2011-11-03 9:40 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Stanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
net/mac80211/main.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index d4ee6d2..7710b10 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -100,7 +100,7 @@ static void ieee80211_reconfig_filter(struct work_struct *work)
*/
bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local)
{
- struct ieee80211_channel *chan, *scan_chan;
+ struct ieee80211_channel *chan;
enum nl80211_channel_type channel_type;
/* This logic needs to match logic in ieee80211_hw_config */
@@ -114,7 +114,7 @@ bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local)
else
channel_type = NL80211_CHAN_NO_HT;
} else if (local->tmp_channel) {
- chan = scan_chan = local->tmp_channel;
+ chan = local->tmp_channel;
channel_type = local->tmp_channel_type;
} else {
chan = local->oper_channel;
@@ -135,7 +135,7 @@ bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local)
int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
{
- struct ieee80211_channel *chan, *scan_chan;
+ struct ieee80211_channel *chan;
int ret = 0;
int power;
enum nl80211_channel_type channel_type;
@@ -143,14 +143,12 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
might_sleep();
- scan_chan = local->scan_channel;
-
/* If this off-channel logic ever changes, ieee80211_on_oper_channel
* may need to change as well.
*/
offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
- if (scan_chan) {
- chan = scan_chan;
+ if (local->scan_channel) {
+ chan = local->scan_channel;
/* If scanning on oper channel, use whatever channel-type
* is currently in use.
*/
@@ -159,7 +157,7 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
else
channel_type = NL80211_CHAN_NO_HT;
} else if (local->tmp_channel) {
- chan = scan_chan = local->tmp_channel;
+ chan = local->tmp_channel;
channel_type = local->tmp_channel_type;
} else {
chan = local->oper_channel;
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/3] mac80211: remove useless brackets in ieee80211_cfg_on_oper_channel
2011-11-03 9:40 [PATCH 1/3] mac80211: remove uneeded scan_chan variable Stanislaw Gruszka
@ 2011-11-03 9:40 ` Stanislaw Gruszka
2011-11-08 13:14 ` Johannes Berg
2011-11-03 9:40 ` [PATCH 3/3] mac80211: simplify ieee80211_work_work Stanislaw Gruszka
2011-11-08 13:14 ` [PATCH 1/3] mac80211: remove uneeded scan_chan variable Johannes Berg
2 siblings, 1 reply; 6+ messages in thread
From: Stanislaw Gruszka @ 2011-11-03 9:40 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Stanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
net/mac80211/main.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 7710b10..cd87fd9 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -126,8 +126,8 @@ bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local)
return false;
/* Check current hardware-config against oper_channel. */
- if ((local->oper_channel != local->hw.conf.channel) ||
- (local->_oper_channel_type != local->hw.conf.channel_type))
+ if (local->oper_channel != local->hw.conf.channel ||
+ local->_oper_channel_type != local->hw.conf.channel_type)
return false;
return true;
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] mac80211: remove useless brackets in ieee80211_cfg_on_oper_channel
2011-11-03 9:40 ` [PATCH 2/3] mac80211: remove useless brackets in ieee80211_cfg_on_oper_channel Stanislaw Gruszka
@ 2011-11-08 13:14 ` Johannes Berg
0 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2011-11-08 13:14 UTC (permalink / raw)
To: Stanislaw Gruszka; +Cc: linux-wireless
On Thu, 2011-11-03 at 10:40 +0100, Stanislaw Gruszka wrote:
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
> ---
> net/mac80211/main.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/mac80211/main.c b/net/mac80211/main.c
> index 7710b10..cd87fd9 100644
> --- a/net/mac80211/main.c
> +++ b/net/mac80211/main.c
> @@ -126,8 +126,8 @@ bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local)
> return false;
>
> /* Check current hardware-config against oper_channel. */
> - if ((local->oper_channel != local->hw.conf.channel) ||
> - (local->_oper_channel_type != local->hw.conf.channel_type))
> + if (local->oper_channel != local->hw.conf.channel ||
> + local->_oper_channel_type != local->hw.conf.channel_type)
> return false;
>
> return true;
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/3] mac80211: simplify ieee80211_work_work
2011-11-03 9:40 [PATCH 1/3] mac80211: remove uneeded scan_chan variable Stanislaw Gruszka
2011-11-03 9:40 ` [PATCH 2/3] mac80211: remove useless brackets in ieee80211_cfg_on_oper_channel Stanislaw Gruszka
@ 2011-11-03 9:40 ` Stanislaw Gruszka
2011-11-08 13:14 ` Johannes Berg
2011-11-08 13:14 ` [PATCH 1/3] mac80211: remove uneeded scan_chan variable Johannes Berg
2 siblings, 1 reply; 6+ messages in thread
From: Stanislaw Gruszka @ 2011-11-03 9:40 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Stanislaw Gruszka
Since local->tmp_channel is always NULL in one branch, some code paths
will newer be taken in that branch, so remove them.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
net/mac80211/work.c | 17 +++--------------
1 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index 6c53b6d..788b96e 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -969,10 +969,9 @@ static void ieee80211_work_work(struct work_struct *work)
}
if (!started && !local->tmp_channel) {
- bool on_oper_chan;
- bool tmp_chan_changed = false;
- bool on_oper_chan2;
+ bool on_oper_chan, on_oper_chan2;
enum nl80211_channel_type wk_ct;
+
on_oper_chan = ieee80211_cfg_on_oper_channel(local);
/* Work with existing channel type if possible. */
@@ -981,11 +980,6 @@ static void ieee80211_work_work(struct work_struct *work)
wk_ct = ieee80211_calc_ct(wk->chan_type,
local->hw.conf.channel_type);
- if (local->tmp_channel)
- if ((local->tmp_channel != wk->chan) ||
- (local->tmp_channel_type != wk_ct))
- tmp_chan_changed = true;
-
local->tmp_channel = wk->chan;
local->tmp_channel_type = wk_ct;
/*
@@ -1008,12 +1002,7 @@ static void ieee80211_work_work(struct work_struct *work)
true,
false);
}
- } else if (tmp_chan_changed)
- /* Still off-channel, but on some other
- * channel, so update hardware.
- * PS should already be off-channel.
- */
- ieee80211_hw_config(local, 0);
+ }
started = true;
wk->timeout = jiffies;
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 3/3] mac80211: simplify ieee80211_work_work
2011-11-03 9:40 ` [PATCH 3/3] mac80211: simplify ieee80211_work_work Stanislaw Gruszka
@ 2011-11-08 13:14 ` Johannes Berg
0 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2011-11-08 13:14 UTC (permalink / raw)
To: Stanislaw Gruszka; +Cc: linux-wireless
On Thu, 2011-11-03 at 10:40 +0100, Stanislaw Gruszka wrote:
> Since local->tmp_channel is always NULL in one branch, some code paths
> will newer be taken in that branch, so remove them.
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
> net/mac80211/work.c | 17 +++--------------
> 1 files changed, 3 insertions(+), 14 deletions(-)
>
> diff --git a/net/mac80211/work.c b/net/mac80211/work.c
> index 6c53b6d..788b96e 100644
> --- a/net/mac80211/work.c
> +++ b/net/mac80211/work.c
> @@ -969,10 +969,9 @@ static void ieee80211_work_work(struct work_struct *work)
> }
>
> if (!started && !local->tmp_channel) {
> - bool on_oper_chan;
> - bool tmp_chan_changed = false;
> - bool on_oper_chan2;
> + bool on_oper_chan, on_oper_chan2;
> enum nl80211_channel_type wk_ct;
> +
> on_oper_chan = ieee80211_cfg_on_oper_channel(local);
>
> /* Work with existing channel type if possible. */
> @@ -981,11 +980,6 @@ static void ieee80211_work_work(struct work_struct *work)
> wk_ct = ieee80211_calc_ct(wk->chan_type,
> local->hw.conf.channel_type);
>
> - if (local->tmp_channel)
> - if ((local->tmp_channel != wk->chan) ||
> - (local->tmp_channel_type != wk_ct))
> - tmp_chan_changed = true;
> -
> local->tmp_channel = wk->chan;
> local->tmp_channel_type = wk_ct;
> /*
> @@ -1008,12 +1002,7 @@ static void ieee80211_work_work(struct work_struct *work)
> true,
> false);
> }
> - } else if (tmp_chan_changed)
> - /* Still off-channel, but on some other
> - * channel, so update hardware.
> - * PS should already be off-channel.
> - */
> - ieee80211_hw_config(local, 0);
> + }
>
> started = true;
> wk->timeout = jiffies;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] mac80211: remove uneeded scan_chan variable
2011-11-03 9:40 [PATCH 1/3] mac80211: remove uneeded scan_chan variable Stanislaw Gruszka
2011-11-03 9:40 ` [PATCH 2/3] mac80211: remove useless brackets in ieee80211_cfg_on_oper_channel Stanislaw Gruszka
2011-11-03 9:40 ` [PATCH 3/3] mac80211: simplify ieee80211_work_work Stanislaw Gruszka
@ 2011-11-08 13:14 ` Johannes Berg
2 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2011-11-08 13:14 UTC (permalink / raw)
To: Stanislaw Gruszka; +Cc: linux-wireless
On Thu, 2011-11-03 at 10:40 +0100, Stanislaw Gruszka wrote:
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
> ---
> net/mac80211/main.c | 14 ++++++--------
> 1 files changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/net/mac80211/main.c b/net/mac80211/main.c
> index d4ee6d2..7710b10 100644
> --- a/net/mac80211/main.c
> +++ b/net/mac80211/main.c
> @@ -100,7 +100,7 @@ static void ieee80211_reconfig_filter(struct work_struct *work)
> */
> bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local)
> {
> - struct ieee80211_channel *chan, *scan_chan;
> + struct ieee80211_channel *chan;
> enum nl80211_channel_type channel_type;
>
> /* This logic needs to match logic in ieee80211_hw_config */
> @@ -114,7 +114,7 @@ bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local)
> else
> channel_type = NL80211_CHAN_NO_HT;
> } else if (local->tmp_channel) {
> - chan = scan_chan = local->tmp_channel;
> + chan = local->tmp_channel;
> channel_type = local->tmp_channel_type;
> } else {
> chan = local->oper_channel;
> @@ -135,7 +135,7 @@ bool ieee80211_cfg_on_oper_channel(struct ieee80211_local *local)
>
> int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
> {
> - struct ieee80211_channel *chan, *scan_chan;
> + struct ieee80211_channel *chan;
> int ret = 0;
> int power;
> enum nl80211_channel_type channel_type;
> @@ -143,14 +143,12 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
>
> might_sleep();
>
> - scan_chan = local->scan_channel;
> -
> /* If this off-channel logic ever changes, ieee80211_on_oper_channel
> * may need to change as well.
> */
> offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
> - if (scan_chan) {
> - chan = scan_chan;
> + if (local->scan_channel) {
> + chan = local->scan_channel;
> /* If scanning on oper channel, use whatever channel-type
> * is currently in use.
> */
> @@ -159,7 +157,7 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
> else
> channel_type = NL80211_CHAN_NO_HT;
> } else if (local->tmp_channel) {
> - chan = scan_chan = local->tmp_channel;
> + chan = local->tmp_channel;
> channel_type = local->tmp_channel_type;
> } else {
> chan = local->oper_channel;
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-11-08 13:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-03 9:40 [PATCH 1/3] mac80211: remove uneeded scan_chan variable Stanislaw Gruszka
2011-11-03 9:40 ` [PATCH 2/3] mac80211: remove useless brackets in ieee80211_cfg_on_oper_channel Stanislaw Gruszka
2011-11-08 13:14 ` Johannes Berg
2011-11-03 9:40 ` [PATCH 3/3] mac80211: simplify ieee80211_work_work Stanislaw Gruszka
2011-11-08 13:14 ` Johannes Berg
2011-11-08 13:14 ` [PATCH 1/3] mac80211: remove uneeded scan_chan variable Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox