2022-09-11 16:54:28

by Michael Straube

[permalink] [raw]
Subject: [PATCH 0/6] staging: r8188eu: some coding style cleanups

This series contains some coding style cleanups in the file
odm_HWConfig.c.

Michael Straube (6):
staging: r8188eu: rename odm_SignalScaleMapping()
staging: r8188eu: clean up camel case in odm_signal_scale_mapping()
staging: r8188eu: remove unnecessary initialization
staging: r8188eu: rename odm_QueryRxPwrPercentage()
staging: r8188eu: clean up camel case in odm_query_rxpwrpercentage()
staging: r8188eu: replace tabs with space in
odm_query_rxpwrpercentage()

drivers/staging/r8188eu/hal/odm_HWConfig.c | 60 +++++++++++-----------
1 file changed, 30 insertions(+), 30 deletions(-)

--
2.37.3


2022-09-11 16:56:12

by Michael Straube

[permalink] [raw]
Subject: [PATCH 5/6] staging: r8188eu: clean up camel case in odm_query_rxpwrpercentage()

Rename the variable 'AntPower' in odm_query_rxpwrpercentage() to avoid
camel case.

AntPower -> antpower

Signed-off-by: Michael Straube <[email protected]>
---
drivers/staging/r8188eu/hal/odm_HWConfig.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/odm_HWConfig.c b/drivers/staging/r8188eu/hal/odm_HWConfig.c
index 8b292644b38c..a870973395f6 100644
--- a/drivers/staging/r8188eu/hal/odm_HWConfig.c
+++ b/drivers/staging/r8188eu/hal/odm_HWConfig.c
@@ -3,14 +3,14 @@

#include "../include/drv_types.h"

-static u8 odm_query_rxpwrpercentage(s8 AntPower)
+static u8 odm_query_rxpwrpercentage(s8 antpower)
{
- if ((AntPower <= -100) || (AntPower >= 20))
+ if ((antpower <= -100) || (antpower >= 20))
return 0;
- else if (AntPower >= 0)
+ else if (antpower >= 0)
return 100;
else
- return 100 + AntPower;
+ return 100 + antpower;
}

static s32 odm_signal_scale_mapping(struct odm_dm_struct *dm_odm, s32 currsig)
--
2.37.3

2022-09-11 16:59:20

by Michael Straube

[permalink] [raw]
Subject: [PATCH 3/6] staging: r8188eu: remove unnecessary initialization

The variable 'retsig' in odm_signal_scale_mapping() is set in the
function before it returns, so it is not needed to initialize it.

Signed-off-by: Michael Straube <[email protected]>
---
drivers/staging/r8188eu/hal/odm_HWConfig.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/r8188eu/hal/odm_HWConfig.c b/drivers/staging/r8188eu/hal/odm_HWConfig.c
index 5fd53c60f762..a557c5d1542e 100644
--- a/drivers/staging/r8188eu/hal/odm_HWConfig.c
+++ b/drivers/staging/r8188eu/hal/odm_HWConfig.c
@@ -15,7 +15,7 @@ static u8 odm_QueryRxPwrPercentage(s8 AntPower)

static s32 odm_signal_scale_mapping(struct odm_dm_struct *dm_odm, s32 currsig)
{
- s32 retsig = 0;
+ s32 retsig;

if (currsig >= 51 && currsig <= 100)
retsig = 100;
--
2.37.3

2022-09-11 17:18:52

by Philipp Hortmann

[permalink] [raw]
Subject: Re: [PATCH 0/6] staging: r8188eu: some coding style cleanups

On 9/11/22 18:19, Michael Straube wrote:
> This series contains some coding style cleanups in the file
> odm_HWConfig.c.
>
> Michael Straube (6):
> staging: r8188eu: rename odm_SignalScaleMapping()
> staging: r8188eu: clean up camel case in odm_signal_scale_mapping()
> staging: r8188eu: remove unnecessary initialization
> staging: r8188eu: rename odm_QueryRxPwrPercentage()
> staging: r8188eu: clean up camel case in odm_query_rxpwrpercentage()
> staging: r8188eu: replace tabs with space in
> odm_query_rxpwrpercentage()
>
> drivers/staging/r8188eu/hal/odm_HWConfig.c | 60 +++++++++++-----------
> 1 file changed, 30 insertions(+), 30 deletions(-)
>

Tested-by: Philipp Hortmann <[email protected]> # Edimax N150