mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 06:31:52 +00:00
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. Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com> Link: https://lore.kernel.org/r/28169210bc26d5fcc1080ed18dc8e043bc3ef30b.1636729147.git.karolinadrobnik@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
460228f19b
commit
9064cb02ee
@ -684,6 +684,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char rf_type,
|
||||
unsigned char init_count = 0;
|
||||
unsigned char sleep_count = 0;
|
||||
unsigned short idx = MISCFIFO_SYNDATA_IDX;
|
||||
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]);
|
||||
|
Loading…
Reference in New Issue
Block a user