Fix several issues reported by checkpatch in rtllib_crypt_ccmp.c file.
Changes in v2:
- Update variable_name in PATCH 3, 4 and 5 to dot11rsna_{variable_name}
- Remove comment from PATCH 3
Khadija Kamran (5):
staging: rtl8192e: remove extra blank lines in rtllib_crypt_ccmp.c
staging: rtl8192e: fix alignment to match open parenthesis
staging: rtl8192e: avoid CamelCase <dot11RSNAStatsCCMPFormatErrors>
staging: rtl8192e: avoid CamelCase <dot11RSNAStatsCCMPReplays>
staging: rtl8192e: avoid CamelCase <dot11RSNAStatsCCMPDecryptErrors>
drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 32 +++++++-------------
1 file changed, 11 insertions(+), 21 deletions(-)
--
2.34.1
Remove extra blank lines as suggested by the Linux kernel coding-style.
These issues were reported by checkpatch.
"CHECK: Please don't use multiple blank lines"
Signed-off-by: Khadija Kamran <[email protected]>
---
drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
index a8d22da8bc9a..eb7b6deb2ca7 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
@@ -74,7 +74,6 @@ static void *rtllib_ccmp_init(int key_idx)
return NULL;
}
-
static void rtllib_ccmp_deinit(void *priv)
{
struct rtllib_ccmp_data *_priv = priv;
@@ -84,7 +83,6 @@ static void rtllib_ccmp_deinit(void *priv)
kfree(priv);
}
-
static int ccmp_init_iv_and_aad(struct rtllib_hdr_4addr *hdr,
u8 *pn, u8 *iv, u8 *aad)
{
@@ -150,8 +148,6 @@ static int ccmp_init_iv_and_aad(struct rtllib_hdr_4addr *hdr,
return aad_len;
}
-
-
static int rtllib_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
{
struct rtllib_ccmp_data *key = priv;
@@ -220,7 +216,6 @@ static int rtllib_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
return 0;
}
-
static int rtllib_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
{
struct rtllib_ccmp_data *key = priv;
@@ -315,7 +310,6 @@ static int rtllib_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
return keyidx;
}
-
static int rtllib_ccmp_set_key(void *key, int len, u8 *seq, void *priv)
{
struct rtllib_ccmp_data *data = priv;
@@ -349,7 +343,6 @@ static int rtllib_ccmp_set_key(void *key, int len, u8 *seq, void *priv)
return 0;
}
-
static int rtllib_ccmp_get_key(void *key, int len, u8 *seq, void *priv)
{
struct rtllib_ccmp_data *data = priv;
@@ -373,7 +366,6 @@ static int rtllib_ccmp_get_key(void *key, int len, u8 *seq, void *priv)
return CCMP_TK_LEN;
}
-
static void rtllib_ccmp_print_stats(struct seq_file *m, void *priv)
{
struct rtllib_ccmp_data *ccmp = priv;
@@ -403,13 +395,11 @@ static struct lib80211_crypto_ops rtllib_crypt_ccmp = {
.owner = THIS_MODULE,
};
-
static int __init rtllib_crypto_ccmp_init(void)
{
return lib80211_register_crypto_ops(&rtllib_crypt_ccmp);
}
-
static void __exit rtllib_crypto_ccmp_exit(void)
{
lib80211_unregister_crypto_ops(&rtllib_crypt_ccmp);
--
2.34.1
Fix alignemnt to match opening parenthesis as suggested by Linux kernel
coding-style. This issue is reported by checkpatch.
Signed-off-by: Khadija Kamran <[email protected]>
---
drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
index eb7b6deb2ca7..8d3067a6ccca 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
@@ -332,7 +332,7 @@ static int rtllib_ccmp_set_key(void *key, int len, u8 *seq, void *priv)
data->rx_pn[5] = seq[0];
}
if (crypto_aead_setauthsize(data->tfm, CCMP_MIC_LEN) ||
- crypto_aead_setkey(data->tfm, data->key, CCMP_TK_LEN))
+ crypto_aead_setkey(data->tfm, data->key, CCMP_TK_LEN))
return -1;
} else if (len == 0) {
data->key_set = 0;
--
2.34.1
Linux kernel coding-style suggests to not use mixed-case names. Fix
checkpatch issue by changing the variable name from camel case to snake
case.
Signed-off-by: Khadija Kamran <[email protected]>
---
drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
index d37ca72678c8..448c0a931c78 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
@@ -35,7 +35,7 @@ struct rtllib_ccmp_data {
u8 rx_pn[CCMP_PN_LEN];
u32 dot11rsna_stats_ccmp_format_errors;
- u32 dot11RSNAStatsCCMPReplays;
+ u32 dot11rsna_stats_ccmp_replays;
u32 dot11RSNAStatsCCMPDecryptErrors;
int key_idx;
@@ -263,7 +263,7 @@ static int rtllib_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
pn[5] = pos[0];
pos += 8;
if (memcmp(pn, key->rx_pn, CCMP_PN_LEN) <= 0) {
- key->dot11RSNAStatsCCMPReplays++;
+ key->dot11rsna_stats_ccmp_replays++;
return -4;
}
if (!tcb_desc->bHwSec) {
@@ -375,7 +375,7 @@ static void rtllib_ccmp_print_stats(struct seq_file *m, void *priv)
ccmp->key_idx, ccmp->key_set,
ccmp->tx_pn, ccmp->rx_pn,
ccmp->dot11rsna_stats_ccmp_format_errors,
- ccmp->dot11RSNAStatsCCMPReplays,
+ ccmp->dot11rsna_stats_ccmp_replays,
ccmp->dot11RSNAStatsCCMPDecryptErrors);
}
--
2.34.1
Linux kernel coding-style suggests to not use mixed-case names. Fix
checkpatch issue by changing the variable name from camel case to snake
case.
Signed-off-by: Khadija Kamran <[email protected]>
---
drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
index 8d3067a6ccca..d37ca72678c8 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
@@ -34,7 +34,7 @@ struct rtllib_ccmp_data {
u8 tx_pn[CCMP_PN_LEN];
u8 rx_pn[CCMP_PN_LEN];
- u32 dot11RSNAStatsCCMPFormatErrors;
+ u32 dot11rsna_stats_ccmp_format_errors;
u32 dot11RSNAStatsCCMPReplays;
u32 dot11RSNAStatsCCMPDecryptErrors;
@@ -226,7 +226,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->dot11rsna_stats_ccmp_format_errors++;
return -1;
}
@@ -238,7 +238,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->dot11rsna_stats_ccmp_format_errors++;
return -2;
}
keyidx >>= 6;
@@ -374,7 +374,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->dot11rsna_stats_ccmp_format_errors,
ccmp->dot11RSNAStatsCCMPReplays,
ccmp->dot11RSNAStatsCCMPDecryptErrors);
}
--
2.34.1
Linux kernel coding-style suggests to not use mixed-case names. Fix
checkpatch issue by changing the variable name from camel case to snake
case.
Signed-off-by: Khadija Kamran <[email protected]>
---
drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
index 448c0a931c78..f88096bcb181 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
@@ -36,7 +36,7 @@ struct rtllib_ccmp_data {
u32 dot11rsna_stats_ccmp_format_errors;
u32 dot11rsna_stats_ccmp_replays;
- u32 dot11RSNAStatsCCMPDecryptErrors;
+ u32 dot11rsna_stats_ccmp_decrypt_errors;
int key_idx;
@@ -296,7 +296,7 @@ static int rtllib_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
pr_debug("CCMP: decrypt failed: STA= %pM\n",
hdr->addr2);
}
- key->dot11RSNAStatsCCMPDecryptErrors++;
+ key->dot11rsna_stats_ccmp_decrypt_errors++;
return -5;
}
@@ -376,7 +376,7 @@ static void rtllib_ccmp_print_stats(struct seq_file *m, void *priv)
ccmp->tx_pn, ccmp->rx_pn,
ccmp->dot11rsna_stats_ccmp_format_errors,
ccmp->dot11rsna_stats_ccmp_replays,
- ccmp->dot11RSNAStatsCCMPDecryptErrors);
+ ccmp->dot11rsna_stats_ccmp_decrypt_errors);
}
static struct lib80211_crypto_ops rtllib_crypt_ccmp = {
--
2.34.1
On 4/2/23 16:32, Khadija Kamran wrote:
> Fix several issues reported by checkpatch in rtllib_crypt_ccmp.c file.
>
> Changes in v2:
> - Update variable_name in PATCH 3, 4 and 5 to dot11rsna_{variable_name}
> - Remove comment from PATCH 3
>
> Khadija Kamran (5):
> staging: rtl8192e: remove extra blank lines in rtllib_crypt_ccmp.c
> staging: rtl8192e: fix alignment to match open parenthesis
> staging: rtl8192e: avoid CamelCase <dot11RSNAStatsCCMPFormatErrors>
> staging: rtl8192e: avoid CamelCase <dot11RSNAStatsCCMPReplays>
> staging: rtl8192e: avoid CamelCase <dot11RSNAStatsCCMPDecryptErrors>
>
> drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 32 +++++++-------------
> 1 file changed, 11 insertions(+), 21 deletions(-)
>
Tested-by: Philipp Hortmann <[email protected]>