All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: "Felix Fietkau" <nbd@openwrt.org>,
	linux-wireless@vger.kernel.org, johannes@sipsolutions.net,
	mcgrof@qca.qualcomm.com
Subject: Re: [PATCH 3.7 1/2] cfg80211: fix antenna gain handling
Date: Fri, 5 Oct 2012 23:02:54 +0200	[thread overview]
Message-ID: <506F4AFE.2090301@broadcom.com> (raw)
In-Reply-To: <20121005202220.GA1929@tuxdriver.com>

On 10/05/2012 10:22 PM, John W. Linville wrote:
> Anyone object?  I suspect that Johannes may be a little more
> busy/distracted than usual for the next few days/weeks...
>
> John
>
> On Wed, Oct 03, 2012 at 07:51:46PM +0200, Felix Fietkau wrote:
>> When not intersecting, orig->chan_mag is initialized to zero. Because of
>> that, the regulatory antenna gain limit never gets set.
>>
>> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
>> Cc: stable@vger.kernel.org
>> ---
>>   net/wireless/reg.c |    3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
>> index 3b8cbbc..1a16f19 100644
>> --- a/net/wireless/reg.c
>> +++ b/net/wireless/reg.c
>> @@ -915,8 +915,7 @@ static void handle_channel(struct wiphy *wiphy,
>>
>>   	chan->beacon_found = false;
>>   	chan->flags = flags | bw_flags | map_regdom_flags(reg_rule->flags);
>> -	chan->max_antenna_gain = min(chan->orig_mag,
>> -		(int) MBI_TO_DBI(power_rule->max_antenna_gain));

Just reading the commit message, I would think it better to initialize 
chan->orig_mag to INT_MAX. Just my 0.02$

Gr. AvS

>> +	chan->max_antenna_gain = (int) MBI_TO_DBI(power_rule->max_antenna_gain);
>>   	chan->max_reg_power = (int) MBM_TO_DBM(power_rule->max_eirp);
>>   	if (chan->orig_mpwr) {
>>   		/*
>> --
>> 1.7.9.6 (Apple Git-31.1)
>>
>>
>



  reply	other threads:[~2012-10-05 21:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-03 17:51 [PATCH 3.7 1/2] cfg80211: fix antenna gain handling Felix Fietkau
2012-10-03 17:51 ` [PATCH 3.7 2/2] cfg80211: fix initialization of chan->max_reg_power Felix Fietkau
2012-10-05 20:22   ` John W. Linville
2012-10-05 20:22 ` [PATCH 3.7 1/2] cfg80211: fix antenna gain handling John W. Linville
2012-10-05 21:02   ` Arend van Spriel [this message]
2012-10-05 23:15     ` Felix Fietkau
2012-10-06  8:01       ` Arend van Spriel
2012-10-06 12:26         ` Felix Fietkau
2012-10-06 14:47           ` Johannes Berg
2012-10-06 15:12             ` Felix Fietkau

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=506F4AFE.2090301@broadcom.com \
    --to=arend@broadcom.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mcgrof@qca.qualcomm.com \
    --cc=nbd@openwrt.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.