[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <596ae9bc980379860b5b1785b3ecc88e18121103.1636729147.git.karolinadrobnik@gmail.com>
Date: Mon, 15 Nov 2021 10:55:43 +0000
From: Karolina Drobnik <karolinadrobnik@...il.com>
To: outreachy-kernel@...glegroups.com
Cc: gregkh@...uxfoundation.org, forest@...ttletooquiet.net,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
Karolina Drobnik <karolinadrobnik@...il.com>
Subject: [PATCH v3 2/8] staging: vt6655: Introduce `idx` variable
Add a local variable to store `MISCFIFO_SYNDATA_IDX` offset.
This change helps in shortening the lines in `rf.c` that
are deemed too long by checkpatch.pl.
Signed-off-by: Karolina Drobnik <karolinadrobnik@...il.com>
---
drivers/staging/vt6655/rf.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index aa90890c5c7a..d57fab3f10fb 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -683,6 +683,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char rf_type,
int i;
unsigned char init_count = 0;
unsigned char sleep_count = 0;
+ unsigned short idx = MISCFIFO_SYNDATA_IDX;
VNSvOutPortW(iobase + MAC_REG_MISCFFNDEX, 0);
switch (rf_type) {
@@ -699,11 +700,11 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char rf_type,
return false;
for (i = 0; i < CB_AL2230_INIT_SEQ; i++)
- MACvSetMISCFifo(priv, MISCFIFO_SYNDATA_IDX + i, al2230_init_table[i]);
+ MACvSetMISCFifo(priv, idx + i, al2230_init_table[i]);
- MACvSetMISCFifo(priv, MISCFIFO_SYNDATA_IDX + i, al2230_channel_table0[channel - 1]);
+ MACvSetMISCFifo(priv, idx + i, al2230_channel_table0[channel - 1]);
i++;
- MACvSetMISCFifo(priv, MISCFIFO_SYNDATA_IDX + i, al2230_channel_table1[channel - 1]);
+ MACvSetMISCFifo(priv, idx + i, al2230_channel_table1[channel - 1]);
break;
/* Need to check, PLLON need to be low for channel setting */
@@ -716,17 +717,17 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char rf_type,
if (channel <= CB_MAX_CHANNEL_24G) {
for (i = 0; i < CB_AL7230_INIT_SEQ; i++)
- MACvSetMISCFifo(priv, MISCFIFO_SYNDATA_IDX + i, al7230_init_table[i]);
+ MACvSetMISCFifo(priv, idx + i, al7230_init_table[i]);
} else {
for (i = 0; i < CB_AL7230_INIT_SEQ; i++)
- MACvSetMISCFifo(priv, MISCFIFO_SYNDATA_IDX + i, al7230_init_table_a_mode[i]);
+ MACvSetMISCFifo(priv, idx + i, al7230_init_table_a_mode[i]);
}
- MACvSetMISCFifo(priv, MISCFIFO_SYNDATA_IDX + i, al7230_channel_table0[channel - 1]);
+ MACvSetMISCFifo(priv, idx + i, al7230_channel_table0[channel - 1]);
i++;
- MACvSetMISCFifo(priv, MISCFIFO_SYNDATA_IDX + i, al7230_channel_table1[channel - 1]);
+ MACvSetMISCFifo(priv, idx + i, al7230_channel_table1[channel - 1]);
i++;
- MACvSetMISCFifo(priv, MISCFIFO_SYNDATA_IDX + i, al7230_channel_table2[channel - 1]);
+ MACvSetMISCFifo(priv, idx + i, al7230_channel_table2[channel - 1]);
break;
case RF_NOTHING:
--
2.30.2
Powered by blists - more mailing lists