2010-12-17 15:14:43

by Mohammed Shafi Shajakhan

[permalink] [raw]
Subject: [PATCH] ath9k: Properly initialize channel table for 2GHz

From: Mohammed Shafi Shajakhan <[email protected]>

ath9k channel table for 2Ghz does not seems to initialize the 'band'
parameter.Though it does not seems to cause any visible issue it looks
odd when we initialize the 'band' parameter for 5Ghz channel table while
not so for 2Ghz.

Signed-off-by: Mohammed Shafi Shajakhan <[email protected]>
---
drivers/net/wireless/ath/ath9k/init.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 1238795..b0e5e71 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -48,6 +48,7 @@ MODULE_PARM_DESC(pmqos, "User specified PM-QOS value");
/* We use the hw_value as an index into our private channel structure */

#define CHAN2G(_freq, _idx) { \
+ .band = IEEE80211_BAND_2GHZ, \
.center_freq = (_freq), \
.hw_value = (_idx), \
.max_power = 20, \
--
1.7.0.4



2010-12-18 10:39:45

by Mohammed Shafi Shajakhan

[permalink] [raw]
Subject: Re: [PATCH] ath9k: Properly initialize channel table for 2GHz

On Saturday 18 December 2010 01:21 AM, Luis R. Rodriguez wrote:
> On Fri, Dec 17, 2010 at 7:14 AM, Mohammed Shafi Shajakhan
> <[email protected]> wrote:
>
>> From: Mohammed Shafi Shajakhan<[email protected]>
>>
>> ath9k channel table for 2Ghz does not seems to initialize the 'band'
>> parameter.Though it does not seems to cause any visible issue it looks
>> odd when we initialize the 'band' parameter for 5Ghz channel table while
>> not so for 2Ghz.
>>
>> Signed-off-by: Mohammed Shafi Shajakhan<[email protected]>
>> ---
>> drivers/net/wireless/ath/ath9k/init.c | 1 +
>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
>> index 1238795..b0e5e71 100644
>> --- a/drivers/net/wireless/ath/ath9k/init.c
>> +++ b/drivers/net/wireless/ath/ath9k/init.c
>> @@ -48,6 +48,7 @@ MODULE_PARM_DESC(pmqos, "User specified PM-QOS value");
>> /* We use the hw_value as an index into our private channel structure */
>>
>> #define CHAN2G(_freq, _idx) { \
>> + .band = IEEE80211_BAND_2GHZ, \
>> .center_freq = (_freq), \
>> .hw_value = (_idx), \
>> .max_power = 20, \
>>
> That's fine but its not needed at all as the band is already
> kzalloc()'d so it gets zeroed out and the IEEE80211_BAND_2GHZ enum is
> 0, so its not required to be explicit and set it. But if it gives you
> the warm fuzzies sure.
>
Oh ok fine, then no problem. I could not trace any warnings if 'band'
parameter was not used, as the code looked suspicious I had sent a patch.
thanks,
shafi

> Luis
>

2010-12-17 19:52:12

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] ath9k: Properly initialize channel table for 2GHz

On Fri, Dec 17, 2010 at 7:14 AM, Mohammed Shafi Shajakhan
<[email protected]> wrote:
> From: Mohammed Shafi Shajakhan <[email protected]>
>
> ath9k channel table for 2Ghz does not seems to initialize the 'band'
> parameter.Though it does not seems to cause any visible issue it looks
> odd when we initialize the 'band' parameter for 5Ghz channel table while
> not so for 2Ghz.
>
> Signed-off-by: Mohammed Shafi Shajakhan <[email protected]>
> ---
>  drivers/net/wireless/ath/ath9k/init.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
> index 1238795..b0e5e71 100644
> --- a/drivers/net/wireless/ath/ath9k/init.c
> +++ b/drivers/net/wireless/ath/ath9k/init.c
> @@ -48,6 +48,7 @@ MODULE_PARM_DESC(pmqos, "User specified PM-QOS value");
>  /* We use the hw_value as an index into our private channel structure */
>
>  #define CHAN2G(_freq, _idx)  { \
> +       .band = IEEE80211_BAND_2GHZ, \
>        .center_freq = (_freq), \
>        .hw_value = (_idx), \
>        .max_power = 20, \

That's fine but its not needed at all as the band is already
kzalloc()'d so it gets zeroed out and the IEEE80211_BAND_2GHZ enum is
0, so its not required to be explicit and set it. But if it gives you
the warm fuzzies sure.

Luis