[01/17] staging: vt6655: changed variable names: wFB_Opt0

Message ID 62f69eddc9641ac9eb045edf8a9453bf36a02b36.1666740522.git.tanjubrunostar0@gmail.com
State New
Headers
Series staging: vt6655: a series of checkpatch fixes on the file: rxtx.c |

Commit Message

Tanjuate Brunostar Oct. 25, 2022, 11:36 p.m. UTC
  change variable names wFB_Opt0 and wFB_Opt1 to meet the
linux coding standard, as it says to avoid using camelCase naming style.
Cought by checkpatch

Signed-off-by: Tanjuate Brunostar <tanjubrunostar0@gmail.com>
---
 drivers/staging/vt6655/rxtx.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)
  

Comments

Philipp Hortmann Oct. 26, 2022, 2:46 a.m. UTC | #1
On 10/26/22 01:36, Tanjuate Brunostar wrote:
> -static const unsigned short wFB_Opt0[2][5] = {
> +static const unsigned short w_fb_opt_0[2][5] = {
>   	{RATE_12M, RATE_18M, RATE_24M, RATE_36M, RATE_48M}, /* fallback_rate0 */
>   	{RATE_12M, RATE_12M, RATE_18M, RATE_24M, RATE_36M}, /* fallback_rate1 */
>   };

In this driver the variables often start with a "w" for "word", "p" for 
"pointer", "b" for "bool", "by" for "byte" and even "pv" for "pointer 
void"...
If possible I would omit those prefixes for the type as they sometimes 
make the variable names even longer and you need to consider how to 
break lines.

Bye Philipp
  
Philipp Hortmann Oct. 26, 2022, 3:24 a.m. UTC | #2
On 10/26/22 01:36, Tanjuate Brunostar wrote:
> change variable names wFB_Opt0 and wFB_Opt1 to meet the
> linux coding standard, as it says to avoid using camelCase naming style.
> Cought by checkpatch
> 
> Signed-off-by: Tanjuate Brunostar<tanjubrunostar0@gmail.com>
> ---
>   drivers/staging/vt6655/rxtx.c | 32 ++++++++++++++++----------------
>   1 file changed, 16 insertions(+), 16 deletions(-)

Applying: staging: vt6655: changed variable names: wFB_Opt0
error: sha1 information is lacking or useless 
(drivers/staging/vt6655/rxtx.c).
error: could not build fake ancestor
Patch failed at 0001 staging: vt6655: changed variable names: wFB_Opt0

Please rebase
  

Patch

diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index d585435520b3..ac9b3402be4f 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -59,12 +59,12 @@  static const unsigned short wTimeStampOff[2][MAX_RATE] = {
 	{384, 192, 130, 113, 54, 43, 37, 31, 28, 25, 24, 23}, /* Short Preamble */
 };
 
-static const unsigned short wFB_Opt0[2][5] = {
+static const unsigned short w_fb_opt_0[2][5] = {
 	{RATE_12M, RATE_18M, RATE_24M, RATE_36M, RATE_48M}, /* fallback_rate0 */
 	{RATE_12M, RATE_12M, RATE_18M, RATE_24M, RATE_36M}, /* fallback_rate1 */
 };
 
-static const unsigned short wFB_Opt1[2][5] = {
+static const unsigned short w_fb_opt_1[2][5] = {
 	{RATE_12M, RATE_18M, RATE_24M, RATE_24M, RATE_36M}, /* fallback_rate0 */
 	{RATE_6M,  RATE_6M,  RATE_12M, RATE_12M, RATE_18M}, /* fallback_rate1 */
 };
@@ -299,9 +299,9 @@  static unsigned int s_uGetDataDuration(struct vnt_private *pDevice,
 			wRate -= RATE_18M;
 
 			if (byFBOption == AUTO_FB_0)
-				wRate = wFB_Opt0[FB_RATE0][wRate];
+				wRate = w_fb_opt_0[FB_RATE0][wRate];
 			else
-				wRate = wFB_Opt1[FB_RATE0][wRate];
+				wRate = w_fb_opt_1[FB_RATE0][wRate];
 
 			uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType,
 						       len, wRate, bNeedAck);
@@ -360,11 +360,11 @@  static __le16 s_uGetRTSCTSDuration(struct vnt_private *pDevice,
 		if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
 			uDurTime = uCTSTime + 2 * pDevice->uSIFS +
 				s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
-						wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck);
+						w_fb_opt_0[FB_RATE0][wRate - RATE_18M], bNeedAck);
 		else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
 			uDurTime = uCTSTime + 2 * pDevice->uSIFS +
 				s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
-						wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck);
+						w_fb_opt_1[FB_RATE0][wRate - RATE_18M], bNeedAck);
 
 		break;
 
@@ -374,11 +374,11 @@  static __le16 s_uGetRTSCTSDuration(struct vnt_private *pDevice,
 		if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
 			uDurTime = uCTSTime + 2 * pDevice->uSIFS +
 				s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
-						wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck);
+						w_fb_opt_0[FB_RATE0][wRate - RATE_18M], bNeedAck);
 		else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
 			uDurTime = uCTSTime + 2 * pDevice->uSIFS +
 				s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
-						wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck);
+						w_fb_opt_1[FB_RATE0][wRate - RATE_18M], bNeedAck);
 
 		break;
 
@@ -388,11 +388,11 @@  static __le16 s_uGetRTSCTSDuration(struct vnt_private *pDevice,
 		if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
 			uDurTime = uCTSTime + 2 * pDevice->uSIFS +
 				s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
-						wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck);
+						w_fb_opt_0[FB_RATE1][wRate - RATE_18M], bNeedAck);
 		else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
 			uDurTime = uCTSTime + 2 * pDevice->uSIFS +
 				s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
-						wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck);
+						w_fb_opt_1[FB_RATE1][wRate - RATE_18M], bNeedAck);
 
 		break;
 
@@ -402,11 +402,11 @@  static __le16 s_uGetRTSCTSDuration(struct vnt_private *pDevice,
 		if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
 			uDurTime = uCTSTime + 2 * pDevice->uSIFS +
 				s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
-						wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck);
+						w_fb_opt_0[FB_RATE1][wRate - RATE_18M], bNeedAck);
 		else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
 			uDurTime = uCTSTime + 2 * pDevice->uSIFS +
 				s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
-						wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck);
+						w_fb_opt_1[FB_RATE1][wRate - RATE_18M], bNeedAck);
 
 		break;
 
@@ -414,11 +414,11 @@  static __le16 s_uGetRTSCTSDuration(struct vnt_private *pDevice,
 		if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
 			uDurTime = pDevice->uSIFS +
 				s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
-						wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck);
+						w_fb_opt_0[FB_RATE0][wRate - RATE_18M], bNeedAck);
 		else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
 			uDurTime = pDevice->uSIFS +
 				s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
-						wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck);
+						w_fb_opt_1[FB_RATE0][wRate - RATE_18M], bNeedAck);
 
 		break;
 
@@ -426,11 +426,11 @@  static __le16 s_uGetRTSCTSDuration(struct vnt_private *pDevice,
 		if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
 			uDurTime = pDevice->uSIFS +
 				s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
-						wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck);
+						w_fb_opt_0[FB_RATE1][wRate - RATE_18M], bNeedAck);
 		else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
 			uDurTime = pDevice->uSIFS +
 				s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
-						wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck);
+						w_fb_opt_1[FB_RATE1][wRate - RATE_18M], bNeedAck);
 
 		break;