2024-01-08 03:23:07

by Gary Rookard

[permalink] [raw]
Subject: [PATCH 0/5] staging: rtl8192e: renamed variable is40MHz and 4 other

Hi,

This patch series renames (5) different variables with
the checkpatch coding style issue, Avoid CamelCase.

Patch 1/5) rename variable is40MHz
Patch 2/5) rename variable isShortGI
Patch 3/5) rename variable retValue
Patch 4/5) rename variable EWC11NHTCap
Patch 5/5) rename variable AdvCoding

Signed-off-by: Gary Rookard <[email protected]>

Gary Rookard (5):
staging: rtl8192e: rename variable is40MHz
staging: rtl8192e: rename variable isShortGI
staging: rtl8192e: rename variable retValue
staging: rtl8192e: rename variable EWC11NHTCap
staging: rtl8192e: rename variable AdvCoding

drivers/staging/rtl8192e/rtl819x_HT.h | 2 +-
drivers/staging/rtl8192e/rtl819x_HTProc.c | 58 +++++++++++------------
2 files changed, 30 insertions(+), 30 deletions(-)

--
2.43.0



2024-01-08 03:23:27

by Gary Rookard

[permalink] [raw]
Subject: [PATCH 1/5] staging: rtl8192e: rename variable is40MHz

Coding style issue, checkpatch avoid CamelCase,
rename it. is40MHz -> is_40mhz

Signed-off-by: Gary Rookard <[email protected]>
---
drivers/staging/rtl8192e/rtl819x_HTProc.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 6d0912f90198..1b1cb9514028 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -87,36 +87,36 @@ static u16 ht_mcs_to_data_rate(struct rtllib_device *ieee, u8 mcs_rate)
{
struct rt_hi_throughput *ht_info = ieee->ht_info;

- u8 is40MHz = (ht_info->cur_bw_40mhz) ? 1 : 0;
+ u8 is_40mhz = (ht_info->cur_bw_40mhz) ? 1 : 0;
u8 isShortGI = (ht_info->cur_bw_40mhz) ?
((ht_info->cur_short_gi_40mhz) ? 1 : 0) :
((ht_info->cur_short_gi_20mhz) ? 1 : 0);
- return MCS_DATA_RATE[is40MHz][isShortGI][(mcs_rate & 0x7f)];
+ return MCS_DATA_RATE[is_40mhz][isShortGI][(mcs_rate & 0x7f)];
}

u16 tx_count_to_data_rate(struct rtllib_device *ieee, u8 data_rate)
{
u16 cck_of_dm_rate[12] = {0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18,
0x24, 0x30, 0x48, 0x60, 0x6c};
- u8 is40MHz = 0;
+ u8 is_40mhz = 0;
u8 isShortGI = 0;

if (data_rate < 12)
return cck_of_dm_rate[data_rate];
if (data_rate >= 0x10 && data_rate <= 0x1f) {
- is40MHz = 0;
+ is_40mhz = 0;
isShortGI = 0;
} else if (data_rate >= 0x20 && data_rate <= 0x2f) {
- is40MHz = 1;
+ is_40mhz = 1;
isShortGI = 0;
} else if (data_rate >= 0x30 && data_rate <= 0x3f) {
- is40MHz = 0;
+ is_40mhz = 0;
isShortGI = 1;
} else if (data_rate >= 0x40 && data_rate <= 0x4f) {
- is40MHz = 1;
+ is_40mhz = 1;
isShortGI = 1;
}
- return MCS_DATA_RATE[is40MHz][isShortGI][data_rate & 0xf];
+ return MCS_DATA_RATE[is_40mhz][isShortGI][data_rate & 0xf];
}

bool is_ht_half_nmode_aps(struct rtllib_device *ieee)
--
2.43.0


2024-01-08 03:23:46

by Gary Rookard

[permalink] [raw]
Subject: [PATCH 2/5] staging: rtl8192e: rename variable isShortGI

Coding style issue, checkpatch Avoid CamelCase,
rename it. isShortGI -> is_short_gi

Signed-off-by: Gary Rookard <[email protected]>
---
drivers/staging/rtl8192e/rtl819x_HTProc.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 1b1cb9514028..43249b9cda44 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -88,10 +88,10 @@ static u16 ht_mcs_to_data_rate(struct rtllib_device *ieee, u8 mcs_rate)
struct rt_hi_throughput *ht_info = ieee->ht_info;

u8 is_40mhz = (ht_info->cur_bw_40mhz) ? 1 : 0;
- u8 isShortGI = (ht_info->cur_bw_40mhz) ?
+ u8 is_short_gi = (ht_info->cur_bw_40mhz) ?
((ht_info->cur_short_gi_40mhz) ? 1 : 0) :
((ht_info->cur_short_gi_20mhz) ? 1 : 0);
- return MCS_DATA_RATE[is_40mhz][isShortGI][(mcs_rate & 0x7f)];
+ return MCS_DATA_RATE[is_40mhz][is_short_gi][(mcs_rate & 0x7f)];
}

u16 tx_count_to_data_rate(struct rtllib_device *ieee, u8 data_rate)
@@ -99,24 +99,24 @@ u16 tx_count_to_data_rate(struct rtllib_device *ieee, u8 data_rate)
u16 cck_of_dm_rate[12] = {0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18,
0x24, 0x30, 0x48, 0x60, 0x6c};
u8 is_40mhz = 0;
- u8 isShortGI = 0;
+ u8 is_short_gi = 0;

if (data_rate < 12)
return cck_of_dm_rate[data_rate];
if (data_rate >= 0x10 && data_rate <= 0x1f) {
is_40mhz = 0;
- isShortGI = 0;
+ is_short_gi = 0;
} else if (data_rate >= 0x20 && data_rate <= 0x2f) {
is_40mhz = 1;
- isShortGI = 0;
+ is_short_gi = 0;
} else if (data_rate >= 0x30 && data_rate <= 0x3f) {
is_40mhz = 0;
- isShortGI = 1;
+ is_short_gi = 1;
} else if (data_rate >= 0x40 && data_rate <= 0x4f) {
is_40mhz = 1;
- isShortGI = 1;
+ is_short_gi = 1;
}
- return MCS_DATA_RATE[is_40mhz][isShortGI][data_rate & 0xf];
+ return MCS_DATA_RATE[is_40mhz][is_short_gi][data_rate & 0xf];
}

bool is_ht_half_nmode_aps(struct rtllib_device *ieee)
--
2.43.0


2024-01-08 03:24:09

by Gary Rookard

[permalink] [raw]
Subject: [PATCH 3/5] staging: rtl8192e: rename variable retValue

Coding style issue, checkpatch Avoid CamelCase,
rename it. retValue -> ret_value

Signed-off-by: Gary Rookard <[email protected]>
---
drivers/staging/rtl8192e/rtl819x_HTProc.c | 24 +++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 43249b9cda44..fe066d39b563 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -121,7 +121,7 @@ u16 tx_count_to_data_rate(struct rtllib_device *ieee, u8 data_rate)

bool is_ht_half_nmode_aps(struct rtllib_device *ieee)
{
- bool retValue = false;
+ bool ret_value = false;
struct rtllib_network *net = &ieee->current_network;

if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
@@ -130,18 +130,18 @@ bool is_ht_half_nmode_aps(struct rtllib_device *ieee)
(memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
(memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
(net->ralink_cap_exist))
- retValue = true;
+ ret_value = true;
else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
!memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
!memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ||
(net->broadcom_cap_exist))
- retValue = true;
+ ret_value = true;
else if (net->bssht.bd_rt2rt_aggregation)
- retValue = true;
+ ret_value = true;
else
- retValue = false;
+ ret_value = false;

- return retValue;
+ return ret_value;
}

static void ht_iot_peer_determine(struct rtllib_device *ieee)
@@ -190,21 +190,21 @@ static void ht_iot_peer_determine(struct rtllib_device *ieee)
static u8 ht_iot_act_is_mgnt_use_cck_6m(struct rtllib_device *ieee,
struct rtllib_network *network)
{
- u8 retValue = 0;
+ u8 ret_value = 0;

if (ieee->ht_info->iot_peer == HT_IOT_PEER_BROADCOM)
- retValue = 1;
+ ret_value = 1;

- return retValue;
+ return ret_value;
}

static u8 ht_iot_act_is_ccd_fsync(struct rtllib_device *ieee)
{
- u8 retValue = 0;
+ u8 ret_value = 0;

if (ieee->ht_info->iot_peer == HT_IOT_PEER_BROADCOM)
- retValue = 1;
- return retValue;
+ ret_value = 1;
+ return ret_value;
}

static void ht_iot_act_determine_ra_func(struct rtllib_device *ieee, bool bPeerRx2ss)
--
2.43.0


2024-01-08 03:24:39

by Gary Rookard

[permalink] [raw]
Subject: [PATCH 4/5] staging: rtl8192e: rename variable EWC11NHTCap

Coding style issue, checkpatch Avoid CamelCase,
rename it. EWC11NHTCap -> ewc_11n_ht_cap

Signed-off-by: Gary Rookard <[email protected]>
---
drivers/staging/rtl8192e/rtl819x_HTProc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index fe066d39b563..5598e74187cd 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -241,9 +241,9 @@ void ht_construct_capability_element(struct rtllib_device *ieee, u8 *pos_ht_cap,
memset(pos_ht_cap, 0, *len);

if ((assoc) && (ht->peer_ht_spec_ver == HT_SPEC_VER_EWC)) {
- static const u8 EWC11NHTCap[] = { 0x00, 0x90, 0x4c, 0x33 };
+ static const u8 ewc_11n_ht_cap[] = { 0x00, 0x90, 0x4c, 0x33 };

- memcpy(pos_ht_cap, EWC11NHTCap, sizeof(EWC11NHTCap));
+ memcpy(pos_ht_cap, ewc_11n_ht_cap, sizeof(ewc_11n_ht_cap));
cap_ele = (struct ht_capab_ele *)&pos_ht_cap[4];
*len = 30 + 2;
} else {
--
2.43.0


2024-01-08 03:24:51

by Gary Rookard

[permalink] [raw]
Subject: [PATCH 5/5] staging: rtl8192e: rename variable AdvCoding

Coding style issue, checkpatch Avoid CamelCase,
rename it. AdvCoding -> adv_coding

Signed-off-by: Gary Rookard <[email protected]>
---
drivers/staging/rtl8192e/rtl819x_HT.h | 2 +-
drivers/staging/rtl8192e/rtl819x_HTProc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h
index 68577bffb936..95613619d568 100644
--- a/drivers/staging/rtl8192e/rtl819x_HT.h
+++ b/drivers/staging/rtl8192e/rtl819x_HT.h
@@ -24,7 +24,7 @@ enum ht_extchnl_offset {
};

struct ht_capab_ele {
- u8 AdvCoding:1;
+ u8 adv_coding:1;
u8 ChlWidth:1;
u8 MimoPwrSave:2;
u8 GreenField:1;
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 5598e74187cd..351000d3bce7 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -251,7 +251,7 @@ void ht_construct_capability_element(struct rtllib_device *ieee, u8 *pos_ht_cap,
*len = 26 + 2;
}

- cap_ele->AdvCoding = 0;
+ cap_ele->adv_coding = 0;
if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))
cap_ele->ChlWidth = 0;
else
--
2.43.0


2024-01-08 04:46:38

by Philipp Hortmann

[permalink] [raw]
Subject: Re: [PATCH 0/5] staging: rtl8192e: renamed variable is40MHz and 4 other

On 1/8/24 04:22, Gary Rookard wrote:
> Hi,
>
> This patch series renames (5) different variables with
> the checkpatch coding style issue, Avoid CamelCase.
>
> Patch 1/5) rename variable is40MHz
> Patch 2/5) rename variable isShortGI
> Patch 3/5) rename variable retValue
> Patch 4/5) rename variable EWC11NHTCap
> Patch 5/5) rename variable AdvCoding
>
> Signed-off-by: Gary Rookard <[email protected]>
>
> Gary Rookard (5):
> staging: rtl8192e: rename variable is40MHz
> staging: rtl8192e: rename variable isShortGI
> staging: rtl8192e: rename variable retValue
> staging: rtl8192e: rename variable EWC11NHTCap
> staging: rtl8192e: rename variable AdvCoding
>
> drivers/staging/rtl8192e/rtl819x_HT.h | 2 +-
> drivers/staging/rtl8192e/rtl819x_HTProc.c | 58 +++++++++++------------
> 2 files changed, 30 insertions(+), 30 deletions(-)
>

Can be applied on top of other patches send in.
Is working fine on hardware.

Bye Philipp

2024-01-08 07:59:07

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 1/5] staging: rtl8192e: rename variable is40MHz

On Sun, Jan 07, 2024 at 10:22:29PM -0500, Gary Rookard wrote:
> Coding style issue, checkpatch avoid CamelCase,
> rename it. is40MHz -> is_40mhz
>
> Signed-off-by: Gary Rookard <[email protected]>
> ---
> drivers/staging/rtl8192e/rtl819x_HTProc.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> index 6d0912f90198..1b1cb9514028 100644
> --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
> +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> @@ -87,36 +87,36 @@ static u16 ht_mcs_to_data_rate(struct rtllib_device *ieee, u8 mcs_rate)
> {
> struct rt_hi_throughput *ht_info = ieee->ht_info;
>
> - u8 is40MHz = (ht_info->cur_bw_40mhz) ? 1 : 0;
> + u8 is_40mhz = (ht_info->cur_bw_40mhz) ? 1 : 0;

This should be is_40MHz. It's metric. M means Mega. m means milli.

regards,
dan carpenter


2024-01-08 13:30:10

by Gary Rookard

[permalink] [raw]
Subject: Re: [PATCH 1/5] staging: rtl8192e: rename variable is40MHz


Dan Carpenter <[email protected]> writes:

> On Sun, Jan 07, 2024 at 10:22:29PM -0500, Gary Rookard wrote:
>> Coding style issue, checkpatch avoid CamelCase,
>> rename it. is40MHz -> is_40mhz
>>
>> Signed-off-by: Gary Rookard <[email protected]>
>> ---
>> drivers/staging/rtl8192e/rtl819x_HTProc.c | 16 ++++++++--------
>> 1 file changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
>> index 6d0912f90198..1b1cb9514028 100644
>> --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
>> +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
>> @@ -87,36 +87,36 @@ static u16 ht_mcs_to_data_rate(struct rtllib_device *ieee, u8 mcs_rate)
>> {
>> struct rt_hi_throughput *ht_info = ieee->ht_info;
>>
>> - u8 is40MHz = (ht_info->cur_bw_40mhz) ? 1 : 0;
>> + u8 is_40mhz = (ht_info->cur_bw_40mhz) ? 1 : 0;
>
> This should be is_40MHz. It's metric. M means Mega. m means milli.
>
> regards,
> dan carpenter
--
Okay, stupid me didin't give it to much thought that way,
...wow there's more that way then just mine
Good catch!
Regards,
Gary

--
Sent with my mu4e on Void GNU/Linux.


Attachments:
signature.asc (885.00 B)

2024-01-09 01:30:20

by Gary Rookard

[permalink] [raw]
Subject: Re: [PATCH 1/5] staging: rtl8192e: rename variable is40MHz


Gary Rookard <[email protected]> writes:

> Gary Rookard <[email protected]> writes:
>
>> [[PGP Signed Part:Undecided]]
>>
>> Dan Carpenter <[email protected]> writes:
>>
>>> On Sun, Jan 07, 2024 at 10:22:29PM -0500, Gary Rookard wrote:
>>>> Coding style issue, checkpatch avoid CamelCase,
>>>> rename it. is40MHz -> is_40mhz
>>>>
>>>> Signed-off-by: Gary Rookard <[email protected]>
>>>> ---
>>>> drivers/staging/rtl8192e/rtl819x_HTProc.c | 16 ++++++++--------
>>>> 1 file changed, 8 insertions(+), 8 deletions(-)
>>>>
>>>> diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
>>>> index 6d0912f90198..1b1cb9514028 100644
>>>> --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
>>>> +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
>>>> @@ -87,36 +87,36 @@ static u16 ht_mcs_to_data_rate(struct rtllib_device *ieee, u8 mcs_rate)
>>>> {
>>>> struct rt_hi_throughput *ht_info = ieee->ht_info;
>>>>
>>>> - u8 is40MHz = (ht_info->cur_bw_40mhz) ? 1 : 0;
>>>> + u8 is_40mhz = (ht_info->cur_bw_40mhz) ? 1 : 0;
>>>
>>> This should be is_40MHz. It's metric. M means Mega. m means milli.
>>>
>>> regards,
>>> dan carpenter
>> --
>> Okay, stupid me didin't give it to much thought that way,
>> ...wow there's more that way then just mine
>> Good catch!
>> Regards,
>> Gary
--
There's only mine that I can find, I'll fix them up
and resubmit them.

Thanks for your insight.

Regards,
Gary
--
Sent with my mu4e on Void GNU/Linux.


Attachments:
signature.asc (885.00 B)

2024-01-09 07:44:02

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 1/5] staging: rtl8192e: rename variable is40MHz

On Mon, Jan 08, 2024 at 08:25:55PM -0500, Gary Rookard wrote:
> >>> This should be is_40MHz. It's metric. M means Mega. m means milli.
> >>>
> >>> regards,
> >>> dan carpenter
> >> --
> >> Okay, stupid me didin't give it to much thought that way,
> >> ...wow there's more that way then just mine
> >> Good catch!
> >> Regards,
> >> Gary
> --
> There's only mine that I can find, I'll fix them up
> and resubmit them.
>

Thanks for this and for looking at the surrounding code as well.

regards,
dan carpenter