public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: Khadija Kamran <kamrankhadijadj@gmail.com>, outreachy@lists.linux.dev
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org, Deepak R Varma <drv@mailo.com>
Subject: Re: [PATCH 3/5] staging: rtl8192e: avoid camel-case <dot11RSNAStatsCCMPFormatErrors>
Date: Sat, 1 Apr 2023 23:20:36 +0200	[thread overview]
Message-ID: <624a11a3-2461-6c8f-155d-e76e5e3e471e@gmail.com> (raw)
In-Reply-To: <7ed9ed4df19b1ab818fc4b3ec43083e1a051c38e.1680375200.git.kamrankhadijadj@gmail.com>

On 4/1/23 20:58, Khadija Kamran wrote:
> Linux kernel coding-style does not suggest mixed-case names. This issue
> is reported by checkpatch.
> 
> Fix variable name by changing it from camel-case to lower-case. In order
> to describe the variable name better, add a comment above it.
> 

I think you are changing from camel case to snake case.

> Suggested-by: Deepak R Varma <drv@mailo.com>
> Signed-off-by: Khadija Kamran <kamrankhadijadj@gmail.com>
> ---
>   drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
> index 8d3067a6ccca..e8a3bc94efdc 100644
> --- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
> +++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
> @@ -34,7 +34,8 @@ struct rtllib_ccmp_data {
>   	u8 tx_pn[CCMP_PN_LEN];
>   	u8 rx_pn[CCMP_PN_LEN];
>   
> -	u32 dot11RSNAStatsCCMPFormatErrors;
> +	/* .11 RSNA stats for CCMP */
> +	u32 ccmp_format_errors;
>   	u32 dot11RSNAStatsCCMPReplays;
>   	u32 dot11RSNAStatsCCMPDecryptErrors;


Is it obvious that CCMPFormatErrors is a part of dot11RSNAStats? OK. You 
added a comment. Often for me the issue is that the comment is only 
valid to one line or to more?

I would prefer something like: dot11rsna_stats_ccmp_format_err
This is keeping the information the author gave variable and I would 
understand better and see it in every place.

>   
> @@ -226,7 +227,7 @@ static int rtllib_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
>   	u8 pn[6];
>   
>   	if (skb->len < hdr_len + CCMP_HDR_LEN + CCMP_MIC_LEN) {
> -		key->dot11RSNAStatsCCMPFormatErrors++;
> +		key->ccmp_format_errors++;
>   		return -1;
>   	}
>   
> @@ -238,7 +239,7 @@ static int rtllib_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
>   			pr_debug("CCMP: received packet without ExtIV flag from %pM\n",
>   				 hdr->addr2);
>   		}
> -		key->dot11RSNAStatsCCMPFormatErrors++;
> +		key->ccmp_format_errors++;
>   		return -2;
>   	}
>   	keyidx >>= 6;
> @@ -374,7 +375,7 @@ static void rtllib_ccmp_print_stats(struct seq_file *m, void *priv)
>   		   "key[%d] alg=CCMP key_set=%d tx_pn=%pM rx_pn=%pM format_errors=%d replays=%d decrypt_errors=%d\n",
>   		   ccmp->key_idx, ccmp->key_set,
>   		   ccmp->tx_pn, ccmp->rx_pn,
> -		   ccmp->dot11RSNAStatsCCMPFormatErrors,
> +		   ccmp->ccmp_format_errors,
>   		   ccmp->dot11RSNAStatsCCMPReplays,
>   		   ccmp->dot11RSNAStatsCCMPDecryptErrors);
>   }


  reply	other threads:[~2023-04-01 21:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-01 18:58 [PATCH 0/5] staging: rtl8192e: fix checkpatch issues in rtllib_crypt_ccmp.c Khadija Kamran
2023-04-01 18:58 ` [PATCH 1/5] staging: rtl8192e: remove extra blank lines " Khadija Kamran
2023-04-01 18:58 ` [PATCH 2/5] staging: rtl8192e: fix alignment to match open parenthesis Khadija Kamran
2023-04-01 18:58 ` [PATCH 3/5] staging: rtl8192e: avoid camel-case <dot11RSNAStatsCCMPFormatErrors> Khadija Kamran
2023-04-01 21:20   ` Philipp Hortmann [this message]
2023-04-01 18:58 ` [PATCH 4/5] staging: rtl8192e: avoid camel-case <dot11RSNAStatsCCMPReplays> Khadija Kamran
2023-04-01 18:58 ` [PATCH 5/5] staging: rtl8192e: avoid camel-case <dot11RSNAStatsCCMPDecryptErrors> Khadija Kamran

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=624a11a3-2461-6c8f-155d-e76e5e3e471e@gmail.com \
    --to=philipp.g.hortmann@gmail.com \
    --cc=drv@mailo.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kamrankhadijadj@gmail.com \
    --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