[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <814792bedc4f693c0d43f8e1c480f00c5988129a.1635773680.git.karolinadrobnik@gmail.com>
Date: Mon, 1 Nov 2021 14:32:02 +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 v2 4/8] staging: vt6655: Rewrite conditional in AL7320 initialization
Use conditional operator to determine which table for AL7320
initialization should be used. Introduce `init_table` variable
to store this value.
Signed-off-by: Karolina Drobnik <karolinadrobnik@...il.com>
---
drivers/staging/vt6655/rf.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index ea74701917e5..e7672da39a82 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -684,6 +684,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char rf_type,
unsigned short idx = MISCFIFO_SYNDATA_IDX;
unsigned char init_count = 0;
unsigned char sleep_count = 0;
+ const unsigned long *init_table;
VNSvOutPortW(iobase + MAC_REG_MISCFFNDEX, 0);
switch (rf_type) {
@@ -714,13 +715,10 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char rf_type,
if (init_count > (MISCFIFO_SYNDATASIZE - sleep_count))
return false;
- if (channel <= CB_MAX_CHANNEL_24G) {
- for (i = 0; i < CB_AL7230_INIT_SEQ; i++)
- MACvSetMISCFifo(priv, idx++, al7230_init_table[i]);
- } else {
- for (i = 0; i < CB_AL7230_INIT_SEQ; i++)
- MACvSetMISCFifo(priv, idx++, al7230_init_table_a_mode[i]);
- }
+ init_table = (channel <= CB_MAX_CHANNEL_24G) ?
+ al7230_init_table : al7230_init_table_a_mode;
+ for (i = 0; i < CB_AL7230_INIT_SEQ; i++)
+ MACvSetMISCFifo(priv, idx++, init_table[i]);
MACvSetMISCFifo(priv, idx++, al7230_channel_table0[channel - 1]);
MACvSetMISCFifo(priv, idx++, al7230_channel_table1[channel - 1]);
--
2.30.2
Powered by blists - more mailing lists