Skip to contentSkip to conversation

staging: rtl8712: style fix multiple line dereference

PATCH Superseded Moon Yeounsu 3 participants 4 messages Jul 17, 2024 – Jul 18, 2024 Staging

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8712: style fix multiple line dereference

It fix the following checkpatch.pl warning:
Avoid multiple line dereference - prefer %s

---
 drivers/staging/rtl8712/rtl871x_cmd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8712/rtl871x_cmd.c +1 -2
index bbd4a13c7bb9..c8a220e04776 100644
@@ -528,8 +528,7 @@ void r8712_setstakey_cmd(struct _adapter *padapter, u8 *psta, u8 unicast_key)
 	if (unicast_key)
 		memcpy(&psetstakey_para->key, &sta->x_UncstKey, 16);
 	else
-		memcpy(&psetstakey_para->key, &psecuritypriv->XGrpKey[psecuritypriv->XGrpKeyid - 1].
-		       skey, 16);
+		memcpy(&psetstakey_para->key, &psecuritypriv->XGrpKey[psecuritypriv->XGrpKeyid - 1].skey, 16);
 	r8712_enqueue_cmd(pcmdpriv, ph2c);
 }
 
Signature · 1 line
2.43.5
#1 lore raw
Quoted 13 lines · Moon Yeounsu

It fix the following checkpatch.pl warning:
Avoid multiple line dereference - prefer %s

---
  drivers/staging/rtl8712/rtl871x_cmd.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8712/rtl871x_cmd.c +0 -0
index bbd4a13c7bb9..c8a220e04776 100644

drivers/staging/rtl8712/rtl871x_cmd.c void r8712_setstakey_cmd(struct _adapter *padapter, u8 *psta, u8 unicast_key) · line 534

Quoted 9 lines
drivers/staging/rtl8712/rtl871x_cmd.c +1 -2
@@ -528,8 +528,7 @@ void r8712_setstakey_cmd(struct _adapter *padapter, u8 *psta, u8 unicast_key)
  	if (unicast_key)
  		memcpy(&psetstakey_para->key, &sta->x_UncstKey, 16);
  	else
-		memcpy(&psetstakey_para->key, &psecuritypriv->XGrpKey[psecuritypriv->XGrpKeyid - 1].
-		       skey, 16);
+		memcpy(&psetstakey_para->key, &psecuritypriv->XGrpKey[psecuritypriv->XGrpKeyid - 1].skey, 16);
  	r8712_enqueue_cmd(pcmdpriv, ph2c);
  }
 

Hi Moon,

you did not use checkpatch on your patch:

kernel@matrix-ESPRIMO-P710:~/Documents/git/kernels/staging$ git commit --amend
WARNING: line length of 110 exceeds 100 columns
#21: FILE: drivers/staging/rtl8712/rtl871x_cmd.c:531:
+		memcpy(&psetstakey_para->key, &psecuritypriv->XGrpKey[psecuritypriv->XGrpKeyid - 1].skey, 16);

CHECK: Avoid CamelCase: <XGrpKey>
#21: FILE: drivers/staging/rtl8712/rtl871x_cmd.c:531:
+ memcpy(&psetstakey_para->key, &psecuritypriv->XGrpKey[psecuritypriv->XGrpKeyid - 1].skey, 16);

CHECK: Avoid CamelCase: <XGrpKeyid>
#21: FILE: drivers/staging/rtl8712/rtl871x_cmd.c:531:
+ memcpy(&psetstakey_para->key, &psecuritypriv->XGrpKey[psecuritypriv->XGrpKeyid - 1].skey, 16);

WARNING: From:/Signed-off-by: email address mismatch: 'From: Moon Yeounsu <[email protected]>' != 'Signed-off-by: Moon Yeounsu <[email protected]>'

total: 0 errors, 2 warnings, 2 checks, 9 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or
--fix-inplace.

"[PATCH] staging: rtl8712: style fix multiple line dereference" has style problems, please review.

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
[staging-testing b055801a1388] staging: rtl8712: style fix multiple line dereference
Author: Moon Yeounsu <[email protected]>
Date: Wed Jul 17 09:06:36 2024 -0400

 1 file changed, 1 insertion(+), 2 deletions(-)

The two warnings need to be fixed. But it is very difficult to fix the line break as you would need to shorten the line itself. May be you like to start with something else. Feel free to contact me directly for any question.

If you send in a second version of this patch please use a change history. Description from Dan under:
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/

Bye Philipp

#2 lore raw
Quoted 3 lines · Philipp Hortmann

The two warnings need to be fixed. But it is very difficult to fix the line break as you would need to shorten the line itself. May be you like to start with something else. Feel free to contact me directly for any question.

I would shorten it like below:

regards,
dan carpenter

drivers/staging/rtl8712/rtl871x_cmd.c +3 -2
index bbd4a13c7bb9..ffeb91dd28c4 100644
@@ -528,8 +528,9 @@ void r8712_setstakey_cmd(struct _adapter *padapter, u8 *psta, u8 unicast_key)
 	if (unicast_key)
 		memcpy(&psetstakey_para->key, &sta->x_UncstKey, 16);
 	else
-		memcpy(&psetstakey_para->key, &psecuritypriv->XGrpKey[psecuritypriv->XGrpKeyid - 1].
-		       skey, 16);
+		memcpy(&psetstakey_para->key,
+		       &psecuritypriv->XGrpKey[psecuritypriv->XGrpKeyid - 1].skey,
+		       16);
 	r8712_enqueue_cmd(pcmdpriv, ph2c);
 }
 
#3 lore raw

PATCH v2 1/1 staging: rtl8712: style fix multiple line dereference

It fix the following checkpatch.pl warning:
Avoid multiple line dereference - prefer %s

---
v2: Fix email address and checkpatch.pl warning

---
 drivers/staging/rtl8712/rtl871x_cmd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/rtl8712/rtl871x_cmd.c +3 -1
index c8a220e04776..ffeb91dd28c4 100644
@@ -528,7 +528,9 @@ void r8712_setstakey_cmd(struct _adapter *padapter, u8 *psta, u8 unicast_key)
 	if (unicast_key)
 		memcpy(&psetstakey_para->key, &sta->x_UncstKey, 16);
 	else
-		memcpy(&psetstakey_para->key, &psecuritypriv->XGrpKey[psecuritypriv->XGrpKeyid - 1].skey, 16);
+		memcpy(&psetstakey_para->key,
+		       &psecuritypriv->XGrpKey[psecuritypriv->XGrpKeyid - 1].skey,
+		       16);
 	r8712_enqueue_cmd(pcmdpriv, ph2c);
 }
 
Signature · 1 line
2.43.5