From: "Fabio M. De Francesco" <fabio.maria.de.francesco@linux.intel.com>
To: Larry.Finger@lwfinger.net, florian.c.schilhabel@googlemail.com,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
linux-staging@lists.linux.dev,
Ayush Tiwari <ayushtiw0110@gmail.com>
Cc: outreachy@lists.linux.dev
Subject: Re: [PATCH v5] staging: rtl8712: rename tmpVal to avg_val
Date: Wed, 13 Mar 2024 11:08:45 +0100 [thread overview]
Message-ID: <2263049.iZASKD2KPV@fdefranc-mobl3> (raw)
In-Reply-To: <ZfFpW9XvHhUkcspq@ayush-HP-Pavilion-Gaming-Laptop-15-ec0xxx>
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;
> }
> }
prev parent reply other threads:[~2024-03-13 10:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2263049.iZASKD2KPV@fdefranc-mobl3 \
--to=fabio.maria.de.francesco@linux.intel.com \
--cc=Larry.Finger@lwfinger.net \
--cc=ayushtiw0110@gmail.com \
--cc=florian.c.schilhabel@googlemail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=outreachy@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox