linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtlwifi: rtl8821ae: Make sure loop counter is signed on all architectures
@ 2016-04-14 12:48 David Müller
  2016-04-14 15:42 ` Larry Finger
  0 siblings, 1 reply; 6+ messages in thread
From: David Müller @ 2016-04-14 12:48 UTC (permalink / raw)
  To: linux-wireless; +Cc: Larry Finger

The for-loop condition does not work correctly on architectures where "char"
is unsigned. Fix it by using an "int", which may also result in more
efficient code.

Signed-off-by: David Müller <d.mueller@elsoft.ch>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
index 74165b3..fcd84d1 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
@@ -959,7 +959,7 @@ static void _rtl8821ae_phy_store_txpower_by_rate_base(struct ieee80211_hw *hw)
 static void _phy_convert_txpower_dbm_to_relative_value(u32 *data, u8 start,
 						u8 end, u8 base_val)
 {
-	char i = 0;
+	int i = 0;
 	u8 temp_value = 0;
 	u32 temp_data = 0;
 
-- 
2.7.4


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

* Re: [PATCH] rtlwifi: rtl8821ae: Make sure loop counter is signed on all architectures
  2016-04-14 12:48 [PATCH] rtlwifi: rtl8821ae: Make sure loop counter is signed on all architectures David Müller
@ 2016-04-14 15:42 ` Larry Finger
  2016-04-15  6:50   ` [PATCH v2] " David Müller
  0 siblings, 1 reply; 6+ messages in thread
From: Larry Finger @ 2016-04-14 15:42 UTC (permalink / raw)
  To: David Müller, linux-wireless

On 04/14/2016 07:48 AM, David Müller wrote:
> The for-loop condition does not work correctly on architectures where "char"
> is unsigned. Fix it by using an "int", which may also result in more
> efficient code.
>
> Signed-off-by: David Müller <d.mueller@elsoft.ch>
> ---
>   drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
> index 74165b3..fcd84d1 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
> @@ -959,7 +959,7 @@ static void _rtl8821ae_phy_store_txpower_by_rate_base(struct ieee80211_hw *hw)
>   static void _phy_convert_txpower_dbm_to_relative_value(u32 *data, u8 start,
>   						u8 end, u8 base_val)
>   {
> -	char i = 0;
> +	int i = 0;
>   	u8 temp_value = 0;
>   	u32 temp_data = 0;

This change is OK, but as long as you are touching this line, you should remove 
the initialization to zero. The first executable statement of that routine is 
"for (i = 3; i >= 0; --i)", thus there is no possibility that the variable could 
be used without being initialized.


Thanks,

Larry


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

* [PATCH v2] rtlwifi: rtl8821ae: Make sure loop counter is signed on all architectures
  2016-04-14 15:42 ` Larry Finger
@ 2016-04-15  6:50   ` David Müller
  2016-04-15 15:34     ` Larry Finger
  2016-04-26  9:11     ` [v2] rtlwifi: rtl8821ae: Make sure loop counter is signed on allarchitectures Kalle Valo
  0 siblings, 2 replies; 6+ messages in thread
From: David Müller @ 2016-04-15  6:50 UTC (permalink / raw)
  To: linux-wireless; +Cc: Larry Finger

The for-loop condition does not work correctly on architectures where
"char" is unsigned. Fix it by using an "int", which may also result in
more efficient code.

v2: Remove unneeded initialization.

Signed-off-by: David Müller <d.mueller@elsoft.ch>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
index 74165b3..1abd243 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
@@ -959,7 +959,7 @@ static void _rtl8821ae_phy_store_txpower_by_rate_base(struct ieee80211_hw *hw)
 static void _phy_convert_txpower_dbm_to_relative_value(u32 *data, u8 start,
 						u8 end, u8 base_val)
 {
-	char i = 0;
+	int i;
 	u8 temp_value = 0;
 	u32 temp_data = 0;
 
-- 
2.7.4


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

* Re: [PATCH v2] rtlwifi: rtl8821ae: Make sure loop counter is signed on all architectures
  2016-04-15  6:50   ` [PATCH v2] " David Müller
@ 2016-04-15 15:34     ` Larry Finger
  2016-04-26  9:11     ` [v2] rtlwifi: rtl8821ae: Make sure loop counter is signed on allarchitectures Kalle Valo
  1 sibling, 0 replies; 6+ messages in thread
From: Larry Finger @ 2016-04-15 15:34 UTC (permalink / raw)
  To: David Müller, linux-wireless

On 04/15/2016 01:50 AM, David Müller wrote:
> The for-loop condition does not work correctly on architectures where
> "char" is unsigned. Fix it by using an "int", which may also result in
> more efficient code.
>
> v2: Remove unneeded initialization.
>
> Signed-off-by: David Müller <d.mueller@elsoft.ch>
> ---
>   drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
> index 74165b3..1abd243 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
> @@ -959,7 +959,7 @@ static void _rtl8821ae_phy_store_txpower_by_rate_base(struct ieee80211_hw *hw)
>   static void _phy_convert_txpower_dbm_to_relative_value(u32 *data, u8 start,
>   						u8 end, u8 base_val)
>   {
> -	char i = 0;
> +	int i;
>   	u8 temp_value = 0;
>   	u32 temp_data = 0;

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Thanks,

Larry



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

* Re: [v2] rtlwifi: rtl8821ae: Make sure loop counter is signed on allarchitectures
  2016-04-15  6:50   ` [PATCH v2] " David Müller
  2016-04-15 15:34     ` Larry Finger
@ 2016-04-26  9:11     ` Kalle Valo
  2016-04-26  9:39       ` Kalle Valo
  1 sibling, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2016-04-26  9:11 UTC (permalink / raw)
  To: David Müller (ELSOFT AG); +Cc: linux-wireless, Larry Finger

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 378 bytes --]


> The for-loop condition does not work correctly on architectures where
> "char" is unsigned. Fix it by using an "int", which may also result in
> more efficient code.
> 
> v2: Remove unneeded initialization.
> 
> Signed-off-by: David Müller <d.mueller@elsoft.ch>
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Thanks, applied to wireless-drivers-next.git.

Kalle Valo

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

* Re: [v2] rtlwifi: rtl8821ae: Make sure loop counter is signed on allarchitectures
  2016-04-26  9:11     ` [v2] rtlwifi: rtl8821ae: Make sure loop counter is signed on allarchitectures Kalle Valo
@ 2016-04-26  9:39       ` Kalle Valo
  0 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2016-04-26  9:39 UTC (permalink / raw)
  To: David Müller (ELSOFT AG); +Cc: linux-wireless, Larry Finger

Kalle Valo <kvalo@codeaurora.org> writes:

>> The for-loop condition does not work correctly on architectures where
>> "char" is unsigned. Fix it by using an "int", which may also result in
>> more efficient code.
>> 
>> v2: Remove unneeded initialization.
>> 
>> Signed-off-by: David Müller <d.mueller@elsoft.ch>
>> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
>
> Thanks, applied to wireless-drivers-next.git.

But afterwards I removed the change log. That doesn't belong to the
commit log, please add that after "---" line separator.

Also in patchwork your name has (ELSOFT AG), I edited that out.

-- 
Kalle Valo

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

end of thread, other threads:[~2016-04-26  9:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-14 12:48 [PATCH] rtlwifi: rtl8821ae: Make sure loop counter is signed on all architectures David Müller
2016-04-14 15:42 ` Larry Finger
2016-04-15  6:50   ` [PATCH v2] " David Müller
2016-04-15 15:34     ` Larry Finger
2016-04-26  9:11     ` [v2] rtlwifi: rtl8821ae: Make sure loop counter is signed on allarchitectures Kalle Valo
2016-04-26  9:39       ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).