From: Julia Lawall <julia.lawall@inria.fr>
To: Ayush Tiwari <ayushtiw0110@gmail.com>
Cc: Larry.Finger@lwfinger.net, florian.c.schilhabel@googlemail.com,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
linux-staging@lists.linux.dev, outreachy@lists.linux.dev
Subject: Re: [PATCH v2] staging: rtl8712: Change type and name of local variable
Date: Wed, 20 Mar 2024 22:05:03 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.22.394.2403202203470.3361@hadrien> (raw)
In-Reply-To: <Zfs+GKmt9hDZdWt/@ayush-HP-Pavilion-Gaming-Laptop-15-ec0xxx>
On Thu, 21 Mar 2024, Ayush Tiwari wrote:
> Change data type of local variable blnPending from u8 to bool and
> renamed it to len_padding since it only assumes 0 or 1 values and
> seems to add a padding based on wr_sz. This change also address the
> checkpatch warning "Avoid Camelcase".
>
> Signed-off-by: Ayush Tiwari <ayushtiw0110@gmail.com>
> ---
> Changes in v2: Changed values of blnPending from 0/1 to false/true
> and renamed blnPending to len_padding
I don't think "len" is a good choice. That suggests length, which would
be an integer. I suspect that bln is an abbreviation of boolean, and the
while thing should go. But when you remove that, you get pending, not
padding.
julia
>
> drivers/staging/rtl8712/rtl8712_cmd.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c b/drivers/staging/rtl8712/rtl8712_cmd.c
> index bb7db96ed821..f499bbbf5bf5 100644
> --- a/drivers/staging/rtl8712/rtl8712_cmd.c
> +++ b/drivers/staging/rtl8712/rtl8712_cmd.c
> @@ -284,7 +284,7 @@ int r8712_cmd_thread(void *context)
> pcmd = cmd_hdl_filter(padapter, pcmd);
> if (pcmd) { /* if pcmd != NULL, cmd will be handled by f/w */
> struct dvobj_priv *pdvobj = &padapter->dvobjpriv;
> - u8 blnPending = 0;
> + bool len_padding = false;
> u16 cmdcode = pcmd->cmdcode;
>
> pcmdpriv->cmd_issued_cnt++;
> @@ -294,12 +294,12 @@ int r8712_cmd_thread(void *context)
> 0x0000ffff);
> if (pdvobj->ishighspeed) {
> if ((wr_sz % 512) == 0)
> - blnPending = 1;
> + len_padding = true;
> } else {
> if ((wr_sz % 64) == 0)
> - blnPending = 1;
> + len_padding = true;
> }
> - if (blnPending) { /* 32 bytes for TX Desc - 8 offset */
> + if (len_padding) { /* 32 bytes for TX Desc - 8 offset */
> pdesc->txdw0 |= cpu_to_le32(((TXDESC_SIZE +
> OFFSET_SZ + 8) << OFFSET_SHT) &
> 0x00ff0000);
> @@ -318,7 +318,7 @@ int r8712_cmd_thread(void *context)
> (pcmdpriv->cmd_seq << 24));
> pcmdbuf += 2; /* 8 bytes alignment */
> memcpy((u8 *)pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
> - if (blnPending)
> + if (len_padding)
> wr_sz += 8; /* Append 8 bytes */
> r8712_write_mem(padapter, RTL8712_DMA_H2CCMD, wr_sz,
> (u8 *)pdesc);
> --
> 2.40.1
>
>
>
prev parent reply other threads:[~2024-03-20 21:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-20 19:50 [PATCH v2] staging: rtl8712: Change type and name of local variable Ayush Tiwari
2024-03-20 21:05 ` Julia Lawall [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=alpine.DEB.2.22.394.2403202203470.3361@hadrien \
--to=julia.lawall@inria.fr \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).