linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: linux-mmc@vger.kernel.org,
	Tony Olech <tony.olech@elandigitalsystems.com>
Cc: Chris Ball <cjb@laptop.org>
Subject: [PATCH 4/6] mmc: vub300: loop cleanup
Date: Sun, 15 May 2011 20:21:46 -0400	[thread overview]
Message-ID: <1305505308-8767-4-git-send-email-cjb@laptop.org> (raw)
In-Reply-To: <1305505308-8767-1-git-send-email-cjb@laptop.org>

For loops that start with i=0, re-use a single counter int.

Signed-off-by: Chris Ball <cjb@laptop.org>
---
 drivers/mmc/host/vub300.c |   33 ++++++++++++++-------------------
 1 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
index ac2fa06..0463921 100644
--- a/drivers/mmc/host/vub300.c
+++ b/drivers/mmc/host/vub300.c
@@ -905,6 +905,7 @@ static void send_command(struct vub300_mmc_host *vub300)
 	struct mmc_command *cmd = vub300->cmd;
 	struct mmc_data *data = vub300->data;
 	int retval;
+	int i;
 	u8 response_type;
 	if (vub300->app_spec) {
 		switch (cmd->opcode) {
@@ -1014,14 +1015,11 @@ static void send_command(struct vub300_mmc_host *vub300)
 			vub300->resp_len = 0;
 			break;
 		case 16:
-		{
-			int i;
 			for (i = 0; i < ARRAY_SIZE(vub300->fbs); i++)
 				vub300->fbs[i] = 0xFFFF & cmd->arg;
 			response_type = SDRT_1;
 			vub300->resp_len = 6;
 			break;
-		}
 		case 17:
 		case 18:
 		case 24:
@@ -2215,33 +2213,30 @@ static int vub300_probe(struct usb_interface *interface,
 	vub300->command_res_urb = command_res_urb;
 	vub300->usb_timed_out = 0;
 	vub300->dynamic_register_count = 0;
-	{
-		int i;
-		for (i = 0; i < ARRAY_SIZE(vub300->fn); i++) {
-			vub300->fn[i].offload_point = 0;
-			vub300->fn[i].offload_count = 0;
-		}
+
+	for (i = 0; i < ARRAY_SIZE(vub300->fn); i++) {
+		vub300->fn[i].offload_point = 0;
+		vub300->fn[i].offload_count = 0;
 	}
+
 	vub300->total_offload_count = 0;
 	vub300->irq_enabled = 0;
 	vub300->irq_disabled = 0;
 	vub300->irqs_queued = 0;
-	{
-		int i;
-		for (i = 0; i < ARRAY_SIZE(vub300->sdio_register); i++)
-			vub300->sdio_register[i++].activate = 0;
-	}
+
+	for (i = 0; i < ARRAY_SIZE(vub300->sdio_register); i++)
+		vub300->sdio_register[i++].activate = 0;
+
 	vub300->udev = udev;
 	vub300->interface = interface;
 	vub300->cmnd_res_ep = 0;
 	vub300->cmnd_out_ep = 0;
 	vub300->data_inp_ep = 0;
 	vub300->data_out_ep = 0;
-	{
-		int i;
-		for (i = 0; i < ARRAY_SIZE(vub300->fbs); i++)
-			vub300->fbs[i] = 512;
-	}
+
+	for (i = 0; i < ARRAY_SIZE(vub300->fbs); i++)
+		vub300->fbs[i] = 512;
+
 	/*
 	 *      set up the endpoint information
 	 *
-- 
1.7.0.1


  parent reply	other threads:[~2011-05-16  0:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-16  0:21 [PATCH 1/6] mmc: vub300: Formatting cleanup Chris Ball
2011-05-16  0:21 ` [PATCH 2/6] mmc: vub300: add whitespace after module_param decls Chris Ball
2011-05-16  0:21 ` [PATCH 3/6] mmc: vub300: Remove initialization of static ints to 0 Chris Ball
2011-05-16  0:21 ` Chris Ball [this message]
2011-05-16  0:21 ` [PATCH 5/6] mmc: vub300: MODULE_* cleanup Chris Ball
2011-05-16  0:21 ` [PATCH 6/6] mmc: vub300: clean up multiline conditionals Chris Ball

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=1305505308-8767-4-git-send-email-cjb@laptop.org \
    --to=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=tony.olech@elandigitalsystems.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;
as well as URLs for NNTP newsgroup(s).