mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Karolina Drobnik <karolinadrobnik@gmail.com>
To: outreachy-kernel@googlegroups.com
Cc: gregkh@linuxfoundation.org, forest@alittletooquiet.net,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Karolina Drobnik <karolinadrobnik@gmail.com>
Subject: [PATCH v3 3/8] staging: vt6655: Use incrementation in `idx`
Date: Mon, 15 Nov 2021 10:55:44 +0000	[thread overview]
Message-ID: <9affeaf40ddb31e03b21db9acd099db4d80da179.1636729147.git.karolinadrobnik@gmail.com> (raw)
In-Reply-To: <cover.1636729147.git.karolinadrobnik@gmail.com>

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@gmail.com>
---
 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


  parent reply	other threads:[~2021-11-15 10:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 10:55 [PATCH v3 0/8] staging: vt6655: Fix line wrapping in `RFvWriteWakeProgSyn` Karolina Drobnik
2021-11-15 10:55 ` [PATCH v3 1/8] staging: vt6655: Remove unnecessary type casts Karolina Drobnik
2021-11-15 10:55 ` [PATCH v3 2/8] staging: vt6655: Introduce `idx` variable Karolina Drobnik
2021-11-15 10:55 ` Karolina Drobnik [this message]
2021-11-15 10:55 ` [PATCH v3 4/8] staging: vt6655: Rewrite conditional in AL7320 initialization Karolina Drobnik
2021-11-15 10:55 ` [PATCH v3 5/8] staging: vt6655: Rename `RFvWriteWakeProgSyn` function Karolina Drobnik
2021-11-15 10:55 ` [PATCH v3 6/8] staging: vt6655: Update comment for `rf_write_wake_prog_syn` Karolina Drobnik
2021-11-15 10:55 ` [PATCH v3 7/8] staging: vt6655: Delete bogus check for `init_count` in AL2230 Karolina Drobnik
2021-11-15 10:55 ` [PATCH v3 8/8] staging: vt6655: Delete bogus check for `init_count` in AL7230 Karolina Drobnik
2021-11-15 15:47 ` [PATCH v3 0/8] staging: vt6655: Fix line wrapping in `RFvWriteWakeProgSyn` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9affeaf40ddb31e03b21db9acd099db4d80da179.1636729147.git.karolinadrobnik@gmail.com \
    --to=karolinadrobnik@gmail.com \
    --cc=forest@alittletooquiet.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=outreachy-kernel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®