diff mbox

[4/6] mmc: vub300: loop cleanup

Message ID 1305505308-8767-4-git-send-email-cjb@laptop.org (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Ball May 16, 2011, 12:21 a.m. UTC
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 mbox

Patch

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
 	 *