2024-03-13 07:14:10

by Ayush Tiwari

[permalink] [raw]
Subject: [PATCH v3] staging: rtl8712: rename tmpVal to avg_val

Rename local variable tmpVal to avg_val in function process_link_qual
to give intuitive meaning to variable and match the common kernel
coding style.

Signed-off-by: Ayush Tiwari <[email protected]>

Changes in v3: changed variable name tmpVal to avg_val
Changes in v2: added a period in message
---
drivers/staging/rtl8712/rtl8712_recv.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c
index a3c4713c59b3..1fabc5137a4c 100644
--- a/drivers/staging/rtl8712/rtl8712_recv.c
+++ b/drivers/staging/rtl8712/rtl8712_recv.c
@@ -861,7 +861,7 @@ static void query_rx_phy_status(struct _adapter *padapter,
static void process_link_qual(struct _adapter *padapter,
union recv_frame *prframe)
{
- u32 last_evm = 0, tmpVal;
+ u32 last_evm = 0, avg_val;
struct rx_pkt_attrib *pattrib;
struct smooth_rssi_data *sqd = &padapter->recvpriv.signal_qual_data;

@@ -883,8 +883,8 @@ static void process_link_qual(struct _adapter *padapter,
sqd->index = 0;

/* <1> Showed on UI for user, in percentage. */
- tmpVal = sqd->total_val / sqd->total_num;
- padapter->recvpriv.signal = (u8)tmpVal;
+ avg_val = sqd->total_val / sqd->total_num;
+ padapter->recvpriv.signal = (u8)avg_val;
}
}

--
2.40.1



2024-03-13 07:31:46

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH v3] staging: rtl8712: rename tmpVal to avg_val

On Wed, Mar 13, 2024 at 12:43:18PM +0530, Ayush Tiwari wrote:
> Rename local variable tmpVal to avg_val in function process_link_qual
> to give intuitive meaning to variable and match the common kernel
> coding style.
>
> Signed-off-by: Ayush Tiwari <[email protected]>
>
> Changes in v3: changed variable name tmpVal to avg_val
> Changes in v2: added a period in message

It's not an average, it's a percent.

regards,
dan carpenter


2024-03-13 08:00:19

by Julia Lawall

[permalink] [raw]
Subject: Re: [PATCH v3] staging: rtl8712: rename tmpVal to avg_val



On Wed, 13 Mar 2024, Ayush Tiwari wrote:

> Rename local variable tmpVal to avg_val in function process_link_qual
> to give intuitive meaning to variable and match the common kernel
> coding style.
>
> Signed-off-by: Ayush Tiwari <[email protected]>
>
> Changes in v3: changed variable name tmpVal to avg_val
> Changes in v2: added a period in message

This information should be below the ---. Then it will be removed when
the patch is applied. This information is only meaningful to the mailing
list. The git history won't contain the previous versions, so the change
comments won't be meaningful.

julia

> ---
> drivers/staging/rtl8712/rtl8712_recv.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c
> index a3c4713c59b3..1fabc5137a4c 100644
> --- a/drivers/staging/rtl8712/rtl8712_recv.c
> +++ b/drivers/staging/rtl8712/rtl8712_recv.c
> @@ -861,7 +861,7 @@ static void query_rx_phy_status(struct _adapter *padapter,
> static void process_link_qual(struct _adapter *padapter,
> union recv_frame *prframe)
> {
> - u32 last_evm = 0, tmpVal;
> + u32 last_evm = 0, avg_val;
> struct rx_pkt_attrib *pattrib;
> struct smooth_rssi_data *sqd = &padapter->recvpriv.signal_qual_data;
>
> @@ -883,8 +883,8 @@ static void process_link_qual(struct _adapter *padapter,
> sqd->index = 0;
>
> /* <1> Showed on UI for user, in percentage. */
> - tmpVal = sqd->total_val / sqd->total_num;
> - padapter->recvpriv.signal = (u8)tmpVal;
> + avg_val = sqd->total_val / sqd->total_num;
> + padapter->recvpriv.signal = (u8)avg_val;
> }
> }
>
> --
> 2.40.1
>
>
>