* [PATCH v5] staging: rtl8712: rename tmpVal to avg_val
@ 2024-03-13 8:52 Ayush Tiwari
2024-03-13 10:03 ` Dan Carpenter
2024-03-13 10:08 ` Fabio M. De Francesco
0 siblings, 2 replies; 3+ messages in thread
From: Ayush Tiwari @ 2024-03-13 8:52 UTC (permalink / raw)
To: Larry.Finger, florian.c.schilhabel, gregkh, linux-kernel,
linux-staging
Cc: outreachy
Rename local variable tmpVal back 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 <ayushtiw0110@gmail.com>
---
Changes in v5: changed variable name pct_val back to avg_val, as agreed by
Julia and Dan
Changes in v4: changed variable name avg_val to pct_val, as suggested by
Dan
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 0b13d0a04304..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, pct_val;
+ 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. */
- pct_val = sqd->total_val / sqd->total_num;
- padapter->recvpriv.signal = (u8)pct_val;
+ avg_val = sqd->total_val / sqd->total_num;
+ padapter->recvpriv.signal = (u8)avg_val;
}
}
--
2.40.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v5] staging: rtl8712: rename tmpVal to avg_val
2024-03-13 8:52 [PATCH v5] staging: rtl8712: rename tmpVal to avg_val Ayush Tiwari
@ 2024-03-13 10:03 ` Dan Carpenter
2024-03-13 10:08 ` Fabio M. De Francesco
1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-03-13 10:03 UTC (permalink / raw)
To: Ayush Tiwari
Cc: Larry.Finger, florian.c.schilhabel, gregkh, linux-kernel,
linux-staging, outreachy
On Wed, Mar 13, 2024 at 02:22:43PM +0530, Ayush Tiwari wrote:
> Rename local variable tmpVal back to avg_val in function process_link_qual
> to give intuitive meaning to variable and match the common kernel
> coding style.
You're write your patches as if we have applied the previous versions
but we are not going to. Please read my blog on how to send a v2 patch.
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v5] staging: rtl8712: rename tmpVal to avg_val
2024-03-13 8:52 [PATCH v5] staging: rtl8712: rename tmpVal to avg_val Ayush Tiwari
2024-03-13 10:03 ` Dan Carpenter
@ 2024-03-13 10:08 ` Fabio M. De Francesco
1 sibling, 0 replies; 3+ messages in thread
From: Fabio M. De Francesco @ 2024-03-13 10:08 UTC (permalink / raw)
To: Larry.Finger, florian.c.schilhabel, gregkh, linux-kernel,
linux-staging, Ayush Tiwari
Cc: outreachy
On Wednesday, 13 March 2024 09:52:43 CET Ayush Tiwari wrote:
> Rename local variable tmpVal back to avg_val in function process_link_qual
You are making a new patch versions (v5) against your previous one. This is
not how the development process works...
Make v6 against a clean staging tree, and change your commit message
accordingly:
Rename tmpVal to avg_val in process_link_qual() to reflect the intended use of
the variable and conform to the kernel coding style.
Not directly related but, there is no need to say that process_link_qual() is
a function (parentheses already say that). Furthermore, by renaming you make
it clear what is the intended use of symbols, you don't "give meaning" to them
(they already have meaning by the mere fact that they serve their intended
purpose - https://ludwig.guru/s/to+give+meaning+to+something).
Remember that only the final versions of patches, the accepted version, will be
applied against the kernel. Therefore, if this version was good, it couldn't
be applied because in process_link_qual() there is no variable called pct_val.
git-am on your patch gives expected errors:
Applying: staging: rtl8712: rename tmpVal to avg_val
error: patch failed: drivers/staging/rtl8712/rtl8712_recv.c:861
error: drivers/staging/rtl8712/rtl8712_recv.c: patch does not apply
> to give intuitive meaning to variable and match the common kernel
> coding style.
>
> Signed-off-by: Ayush Tiwari <ayushtiw0110@gmail.com>
> ---
>
> [skip]
>
> --- 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, pct_val;
As said, a clean process_link_qual() has no pct_val variable.
Fabio
> + 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. */
> - pct_val = sqd->total_val / sqd->total_num;
> - padapter->recvpriv.signal = (u8)pct_val;
> + avg_val = sqd->total_val / sqd->total_num;
> + padapter->recvpriv.signal = (u8)avg_val;
> }
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-03-13 10:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-13 8:52 [PATCH v5] staging: rtl8712: rename tmpVal to avg_val Ayush Tiwari
2024-03-13 10:03 ` Dan Carpenter
2024-03-13 10:08 ` Fabio M. De Francesco
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox