Increment `idx` in a loop instead of adding the loop counter `i` to do so. Delete increments of `i` that were rendered unnecessary by this change. Signed-off-by: Karolina Drobnik <karolinadrobnik@xxxxxxxxx> --- drivers/staging/vt6655/rf.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c index d57fab3f10fb..ce91a03eb58f 100644 --- a/drivers/staging/vt6655/rf.c +++ b/drivers/staging/vt6655/rf.c @@ -700,11 +700,10 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char rf_type, return false; for (i = 0; i < CB_AL2230_INIT_SEQ; i++) - MACvSetMISCFifo(priv, idx + i, al2230_init_table[i]); + MACvSetMISCFifo(priv, idx++, al2230_init_table[i]); - MACvSetMISCFifo(priv, idx + i, al2230_channel_table0[channel - 1]); - i++; - MACvSetMISCFifo(priv, idx + i, al2230_channel_table1[channel - 1]); + MACvSetMISCFifo(priv, idx++, al2230_channel_table0[channel - 1]); + MACvSetMISCFifo(priv, idx++, al2230_channel_table1[channel - 1]); break; /* Need to check, PLLON need to be low for channel setting */ @@ -717,17 +716,15 @@ 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, idx + i, al7230_init_table[i]); + MACvSetMISCFifo(priv, idx++, al7230_init_table[i]); } else { for (i = 0; i < CB_AL7230_INIT_SEQ; i++) - MACvSetMISCFifo(priv, idx + i, al7230_init_table_a_mode[i]); + MACvSetMISCFifo(priv, idx++, al7230_init_table_a_mode[i]); } - MACvSetMISCFifo(priv, idx + i, al7230_channel_table0[channel - 1]); - i++; - MACvSetMISCFifo(priv, idx + i, al7230_channel_table1[channel - 1]); - i++; - MACvSetMISCFifo(priv, idx + i, al7230_channel_table2[channel - 1]); + MACvSetMISCFifo(priv, idx++, al7230_channel_table0[channel - 1]); + MACvSetMISCFifo(priv, idx++, al7230_channel_table1[channel - 1]); + MACvSetMISCFifo(priv, idx++, al7230_channel_table2[channel - 1]); break; case RF_NOTHING: -- 2.30.2