All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath9k: Properly assign boolean types Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
@ 2010-10-25  7:16 Mohammed Shafi Shajakhan
  2010-10-25 15:58 ` Ben Greear
  2010-10-25 16:28 ` Luis R. Rodriguez
  0 siblings, 2 replies; 6+ messages in thread
From: Mohammed Shafi Shajakhan @ 2010-10-25  7:16 UTC (permalink / raw)
  To: linville
  Cc: linux-wireless, lrodriguez, j, Senthilkumar.Balasubramanian,
	Vasanth.Thiagarajan, nbd, Mohammed Shafi Shajakhan

From: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>

---
 drivers/net/wireless/ath/ath9k/rc.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 0cee90c..0c70839 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1444,12 +1444,15 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
 		ath_rc_priv->neg_ht_rates.rs_nrates = j;
 	}
 
-	is_cw40 = sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40;
+	is_cw40 = (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) ?
+		true : false;
 
 	if (is_cw40)
-		is_sgi = sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40;
+		is_sgi = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ?
+			true : false;
 	else if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_SGI_20)
-		is_sgi = sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20;
+		is_sgi = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) ?
+			true : false
 
 	/* Choose rate table first */
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath9k: Properly assign boolean types Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
  2010-10-25  7:16 [PATCH] ath9k: Properly assign boolean types Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Mohammed Shafi Shajakhan
@ 2010-10-25 15:58 ` Ben Greear
  2010-10-26  2:42   ` Bob Copeland
  2010-10-26  4:36   ` Mohammed Shafi
  2010-10-25 16:28 ` Luis R. Rodriguez
  1 sibling, 2 replies; 6+ messages in thread
From: Ben Greear @ 2010-10-25 15:58 UTC (permalink / raw)
  To: Mohammed Shafi Shajakhan
  Cc: linville, linux-wireless, lrodriguez, j,
	Senthilkumar.Balasubramanian, Vasanth.Thiagarajan, nbd

On 10/25/2010 12:16 AM, Mohammed Shafi Shajakhan wrote:
> From: Mohammed Shafi Shajakhan<mshajakhan@atheros.com>
>
> ---
>   drivers/net/wireless/ath/ath9k/rc.c |    9 ++++++---
>   1 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
> index 0cee90c..0c70839 100644
> --- a/drivers/net/wireless/ath/ath9k/rc.c
> +++ b/drivers/net/wireless/ath/ath9k/rc.c
> @@ -1444,12 +1444,15 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
>   		ath_rc_priv->neg_ht_rates.rs_nrates = j;
>   	}
>
> -	is_cw40 = sta->ht_cap.cap&  IEEE80211_HT_CAP_SUP_WIDTH_20_40;
> +	is_cw40 = (sta->ht_cap.cap&  IEEE80211_HT_CAP_SUP_WIDTH_20_40) ?
> +		true : false;

Maybe use:
is_cw40 = !!(sta->ht_cap.cap&  IEEE80211_HT_CAP_SUP_WIDTH_20_40);

Seems a bit simpler to me...

Ben


>
>   	if (is_cw40)
> -		is_sgi = sta->ht_cap.cap&  IEEE80211_HT_CAP_SGI_40;
> +		is_sgi = (sta->ht_cap.cap&  IEEE80211_HT_CAP_SGI_40) ?
> +			true : false;
>   	else if (sc->sc_ah->caps.hw_caps&  ATH9K_HW_CAP_SGI_20)
> -		is_sgi = sta->ht_cap.cap&  IEEE80211_HT_CAP_SGI_20;
> +		is_sgi = (sta->ht_cap.cap&  IEEE80211_HT_CAP_SGI_20) ?
> +			true : false
>
>   	/* Choose rate table first */
>


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath9k: Properly assign boolean types Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
  2010-10-25  7:16 [PATCH] ath9k: Properly assign boolean types Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Mohammed Shafi Shajakhan
  2010-10-25 15:58 ` Ben Greear
@ 2010-10-25 16:28 ` Luis R. Rodriguez
  2010-10-26  4:27   ` Mohammed Shafi
  1 sibling, 1 reply; 6+ messages in thread
From: Luis R. Rodriguez @ 2010-10-25 16:28 UTC (permalink / raw)
  To: Mohammed Shajakhan
  Cc: linville, linux-wireless, Luis Rodriguez, j,
	Senthilkumar Balasubramanian, Vasanth Thiagarajan, nbd

On Mon, Oct 25, 2010 at 12:16:01AM -0700, Mohammed Shajakhan wrote:
> From: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>

Your SOB is missing, and you put it on the subject

  Luis

> 
> ---
>  drivers/net/wireless/ath/ath9k/rc.c |    9 ++++++---
>  1 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
> index 0cee90c..0c70839 100644
> --- a/drivers/net/wireless/ath/ath9k/rc.c
> +++ b/drivers/net/wireless/ath/ath9k/rc.c
> @@ -1444,12 +1444,15 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
>  		ath_rc_priv->neg_ht_rates.rs_nrates = j;
>  	}
>  
> -	is_cw40 = sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40;
> +	is_cw40 = (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) ?
> +		true : false;
>  
>  	if (is_cw40)
> -		is_sgi = sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40;
> +		is_sgi = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ?
> +			true : false;
>  	else if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_SGI_20)
> -		is_sgi = sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20;
> +		is_sgi = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) ?
> +			true : false
>  
>  	/* Choose rate table first */
>  
> -- 
> 1.7.0.4
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath9k: Properly assign boolean types Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
  2010-10-25 15:58 ` Ben Greear
@ 2010-10-26  2:42   ` Bob Copeland
  2010-10-26  4:36   ` Mohammed Shafi
  1 sibling, 0 replies; 6+ messages in thread
From: Bob Copeland @ 2010-10-26  2:42 UTC (permalink / raw)
  To: Ben Greear
  Cc: Mohammed Shafi Shajakhan, linville, linux-wireless, lrodriguez,
	j, Senthilkumar.Balasubramanian, Vasanth.Thiagarajan, nbd

On Mon, Oct 25, 2010 at 11:58 AM, Ben Greear <greearb@candelatech.com> wrote:
> On 10/25/2010 12:16 AM, Mohammed Shafi Shajakhan wrote:
>> -       is_cw40 = sta->ht_cap.cap&  IEEE80211_HT_CAP_SUP_WIDTH_20_40;
>> +       is_cw40 = (sta->ht_cap.cap&  IEEE80211_HT_CAP_SUP_WIDTH_20_40) ?
>> +               true : false;
>
> Maybe use:
> is_cw40 = !!(sta->ht_cap.cap&  IEEE80211_HT_CAP_SUP_WIDTH_20_40);
>
> Seems a bit simpler to me...

Agreed, !! is idiomatic.

-- 
Bob Copeland %% www.bobcopeland.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath9k: Properly assign boolean types Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
  2010-10-25 16:28 ` Luis R. Rodriguez
@ 2010-10-26  4:27   ` Mohammed Shafi
  0 siblings, 0 replies; 6+ messages in thread
From: Mohammed Shafi @ 2010-10-26  4:27 UTC (permalink / raw)
  To: Luis Rodriguez; +Cc: linux-wireless

I will make the change send a new patch.Thanks Luis.
regards,
shafi

On Monday 25 October 2010 09:58 PM, Luis Rodriguez wrote:
> On Mon, Oct 25, 2010 at 12:16:01AM -0700, Mohammed Shajakhan wrote:
>    
>> From: Mohammed Shafi Shajakhan<mshajakhan@atheros.com>
>>      
> Your SOB is missing, and you put it on the subject
>
>    Luis
>
>    
>> ---
>>   drivers/net/wireless/ath/ath9k/rc.c |    9 ++++++---
>>   1 files changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
>> index 0cee90c..0c70839 100644
>> --- a/drivers/net/wireless/ath/ath9k/rc.c
>> +++ b/drivers/net/wireless/ath/ath9k/rc.c
>> @@ -1444,12 +1444,15 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
>>   		ath_rc_priv->neg_ht_rates.rs_nrates = j;
>>   	}
>>
>> -	is_cw40 = sta->ht_cap.cap&  IEEE80211_HT_CAP_SUP_WIDTH_20_40;
>> +	is_cw40 = (sta->ht_cap.cap&  IEEE80211_HT_CAP_SUP_WIDTH_20_40) ?
>> +		true : false;
>>
>>   	if (is_cw40)
>> -		is_sgi = sta->ht_cap.cap&  IEEE80211_HT_CAP_SGI_40;
>> +		is_sgi = (sta->ht_cap.cap&  IEEE80211_HT_CAP_SGI_40) ?
>> +			true : false;
>>   	else if (sc->sc_ah->caps.hw_caps&  ATH9K_HW_CAP_SGI_20)
>> -		is_sgi = sta->ht_cap.cap&  IEEE80211_HT_CAP_SGI_20;
>> +		is_sgi = (sta->ht_cap.cap&  IEEE80211_HT_CAP_SGI_20) ?
>> +			true : false
>>
>>   	/* Choose rate table first */
>>
>> -- 
>> 1.7.0.4
>>
>>      
> .
>
>    

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ath9k: Properly assign boolean types Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
  2010-10-25 15:58 ` Ben Greear
  2010-10-26  2:42   ` Bob Copeland
@ 2010-10-26  4:36   ` Mohammed Shafi
  1 sibling, 0 replies; 6+ messages in thread
From: Mohammed Shafi @ 2010-10-26  4:36 UTC (permalink / raw)
  To: Ben Greear, Bob Copeland; +Cc: linux-wireless

Thanks , thought of that, but the code seems to use true/false approach, 
will send a new patch with this simple fix.
thanks,
shafi

On Monday 25 October 2010 09:28 PM, Ben Greear wrote:
> On 10/25/2010 12:16 AM, Mohammed Shafi Shajakhan wrote:
>    
>> From: Mohammed Shafi Shajakhan<mshajakhan@atheros.com>
>>
>> ---
>>    drivers/net/wireless/ath/ath9k/rc.c |    9 ++++++---
>>    1 files changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
>> index 0cee90c..0c70839 100644
>> --- a/drivers/net/wireless/ath/ath9k/rc.c
>> +++ b/drivers/net/wireless/ath/ath9k/rc.c
>> @@ -1444,12 +1444,15 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
>>    		ath_rc_priv->neg_ht_rates.rs_nrates = j;
>>    	}
>>
>> -	is_cw40 = sta->ht_cap.cap&   IEEE80211_HT_CAP_SUP_WIDTH_20_40;
>> +	is_cw40 = (sta->ht_cap.cap&   IEEE80211_HT_CAP_SUP_WIDTH_20_40) ?
>> +		true : false;
>>      
> Maybe use:
> is_cw40 = !!(sta->ht_cap.cap&   IEEE80211_HT_CAP_SUP_WIDTH_20_40);
>
> Seems a bit simpler to me...
>
> Ben
>
>
>    
>>    	if (is_cw40)
>> -		is_sgi = sta->ht_cap.cap&   IEEE80211_HT_CAP_SGI_40;
>> +		is_sgi = (sta->ht_cap.cap&   IEEE80211_HT_CAP_SGI_40) ?
>> +			true : false;
>>    	else if (sc->sc_ah->caps.hw_caps&   ATH9K_HW_CAP_SGI_20)
>> -		is_sgi = sta->ht_cap.cap&   IEEE80211_HT_CAP_SGI_20;
>> +		is_sgi = (sta->ht_cap.cap&   IEEE80211_HT_CAP_SGI_20) ?
>> +			true : false
>>
>>    	/* Choose rate table first */
>>
>>      
>
>    

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-10-26  4:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-25  7:16 [PATCH] ath9k: Properly assign boolean types Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Mohammed Shafi Shajakhan
2010-10-25 15:58 ` Ben Greear
2010-10-26  2:42   ` Bob Copeland
2010-10-26  4:36   ` Mohammed Shafi
2010-10-25 16:28 ` Luis R. Rodriguez
2010-10-26  4:27   ` Mohammed Shafi

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.