mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Toshiaki Yamane <yamanetoshi@gmail.com>
To: Greg Kroah-Hartman <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org, Toshiaki Yamane <yamanetoshi@gmail.com>
Subject: [PATCH 38/57] staging/rts_pstor: remove braces {} in sd.c (reset_sd)
Date: Fri,  7 Sep 2012 13:35:00 +0900	[thread overview]
Message-ID: <1346992500-17609-1-git-send-email-yamanetoshi@gmail.com> (raw)
In-Reply-To: <1346991387-16321-1-git-send-email-yamanetoshi@gmail.com>

fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
---
 drivers/staging/rts_pstor/sd.c |  114 ++++++++++++++++------------------------
 1 file changed, 45 insertions(+), 69 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index c9dc000..23fe9f2 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -2216,14 +2216,12 @@ Switch_Fail:
 #endif
 
 	retval = sd_prepare_reset(chip);
-	if (retval != STATUS_SUCCESS) {
+	if (retval != STATUS_SUCCESS)
 		TRACE_RET(chip, STATUS_FAIL);
-	}
 
 	retval = sd_dummy_clock(chip);
-	if (retval != STATUS_SUCCESS) {
+	if (retval != STATUS_SUCCESS)
 		TRACE_RET(chip, STATUS_FAIL);
-	}
 
 	if (CHK_SDIO_EXIST(chip) && !CHK_SDIO_IGNORED(chip) && try_sdio) {
 		int rty_cnt = 0;
@@ -2257,9 +2255,8 @@ Switch_Fail:
 	/* Start Initialization Process of SD Card */
 RTY_SD_RST:
 	retval = sd_send_cmd_get_rsp(chip, GO_IDLE_STATE, 0, SD_RSP_TYPE_R0, NULL, 0);
-	if (retval != STATUS_SUCCESS) {
+	if (retval != STATUS_SUCCESS)
 	       TRACE_RET(chip, STATUS_FAIL);
-	}
 
 	wait_timeout(20);
 
@@ -2286,9 +2283,8 @@ RTY_SD_RST:
 		voltage = SUPPORT_VOLTAGE;
 
 		retval = sd_send_cmd_get_rsp(chip, GO_IDLE_STATE, 0, SD_RSP_TYPE_R0, NULL, 0);
-		if (retval != STATUS_SUCCESS) {
+		if (retval != STATUS_SUCCESS)
 		       TRACE_RET(chip, STATUS_FAIL);
-		}
 
 		wait_timeout(20);
 	}
@@ -2302,42 +2298,38 @@ RTY_SD_RST:
 			}
 
 			j++;
-			if (j < 3) {
+			if (j < 3)
 				goto RTY_SD_RST;
-			} else {
+			else
 				TRACE_RET(chip, STATUS_FAIL);
-			}
 		}
 
 		retval = sd_send_cmd_get_rsp(chip, SD_APP_OP_COND, voltage, SD_RSP_TYPE_R3, rsp, 5);
 		if (retval != STATUS_SUCCESS) {
 			k++;
-			if (k < 3) {
+			if (k < 3)
 				goto RTY_SD_RST;
-			} else {
+			else
 				TRACE_RET(chip, STATUS_FAIL);
-			}
 		}
 
 		i++;
 		wait_timeout(20);
 	} while (!(rsp[1] & 0x80) && (i < 255));
 
-	if (i == 255) {
+	if (i == 255)
 		TRACE_RET(chip, STATUS_FAIL);
-	}
 
 	if (hi_cap_flow) {
-		if (rsp[1] & 0x40) {
+		if (rsp[1] & 0x40)
 			SET_SD_HCXC(sd_card);
-		} else {
+		else
 			CLR_SD_HCXC(sd_card);
-		}
-		if (CHECK_PID(chip, 0x5209) && CHK_SD_HCXC(sd_card) && !sd20_mode) {
+
+		if (CHECK_PID(chip, 0x5209) && CHK_SD_HCXC(sd_card) && !sd20_mode)
 			support_1v8 = (rsp[1] & 0x01) ? 1 : 0;
-		} else {
+		else
 			support_1v8 = 0;
-		}
 	} else {
 		CLR_SD_HCXC(sd_card);
 		support_1v8 = 0;
@@ -2346,46 +2338,39 @@ RTY_SD_RST:
 
 	if (support_1v8) {
 		retval = sd_voltage_switch(chip);
-		if (retval != STATUS_SUCCESS) {
+		if (retval != STATUS_SUCCESS)
 			TRACE_RET(chip, STATUS_FAIL);
-		}
 	}
 
 	retval = sd_send_cmd_get_rsp(chip, ALL_SEND_CID, 0, SD_RSP_TYPE_R2, NULL, 0);
-	if (retval != STATUS_SUCCESS) {
+	if (retval != STATUS_SUCCESS)
 		TRACE_RET(chip, STATUS_FAIL);
-	}
 
 	for (i = 0; i < 3; i++) {
 		retval = sd_send_cmd_get_rsp(chip, SEND_RELATIVE_ADDR, 0, SD_RSP_TYPE_R6, rsp, 5);
-		if (retval != STATUS_SUCCESS) {
+		if (retval != STATUS_SUCCESS)
 			TRACE_RET(chip, STATUS_FAIL);
-		}
 
 		sd_card->sd_addr = (u32)rsp[1] << 24;
 		sd_card->sd_addr += (u32)rsp[2] << 16;
 
-		if (sd_card->sd_addr) {
+		if (sd_card->sd_addr)
 			break;
-		}
 	}
 
 	retval = sd_check_csd(chip, 1);
-	if (retval != STATUS_SUCCESS) {
+	if (retval != STATUS_SUCCESS)
 		TRACE_RET(chip, STATUS_FAIL);
-	}
 
 	retval = sd_select_card(chip, 1);
-	if (retval != STATUS_SUCCESS) {
+	if (retval != STATUS_SUCCESS)
 		TRACE_RET(chip, STATUS_FAIL);
-	}
 
 #ifdef SUPPORT_SD_LOCK
 SD_UNLOCK_ENTRY:
 	retval = sd_update_lock_status(chip);
-	if (retval != STATUS_SUCCESS) {
+	if (retval != STATUS_SUCCESS)
 		TRACE_RET(chip, STATUS_FAIL);
-	}
 
 	if (sd_card->sd_lock_status & SD_LOCKED) {
 		sd_card->sd_lock_status |= (SD_LOCK_1BIT_MODE | SD_PWD_EXIST);
@@ -2396,23 +2381,21 @@ SD_UNLOCK_ENTRY:
 #endif
 
 	retval = sd_send_cmd_get_rsp(chip, APP_CMD, sd_card->sd_addr, SD_RSP_TYPE_R1, NULL, 0);
-	if (retval != STATUS_SUCCESS) {
+	if (retval != STATUS_SUCCESS)
 		TRACE_RET(chip, STATUS_FAIL);
-	}
+
 	retval = sd_send_cmd_get_rsp(chip, SET_CLR_CARD_DETECT, 0, SD_RSP_TYPE_R1, NULL, 0);
-	if (retval != STATUS_SUCCESS) {
+	if (retval != STATUS_SUCCESS)
 		TRACE_RET(chip, STATUS_FAIL);
-	}
 
 	if (support_1v8) {
 		retval = sd_send_cmd_get_rsp(chip, APP_CMD, sd_card->sd_addr, SD_RSP_TYPE_R1, NULL, 0);
-		if (retval != STATUS_SUCCESS) {
+		if (retval != STATUS_SUCCESS)
 			TRACE_RET(chip, STATUS_FAIL);
-		}
+
 		retval = sd_send_cmd_get_rsp(chip, SET_BUS_WIDTH, 2, SD_RSP_TYPE_R1, NULL, 0);
-		if (retval != STATUS_SUCCESS) {
+		if (retval != STATUS_SUCCESS)
 			TRACE_RET(chip, STATUS_FAIL);
-		}
 
 		switch_bus_width = SD_BUS_WIDTH_4;
 	} else {
@@ -2420,14 +2403,12 @@ SD_UNLOCK_ENTRY:
 	}
 
 	retval = sd_send_cmd_get_rsp(chip, SET_BLOCKLEN, 0x200, SD_RSP_TYPE_R1, NULL, 0);
-	if (retval != STATUS_SUCCESS) {
+	if (retval != STATUS_SUCCESS)
 		TRACE_RET(chip, STATUS_FAIL);
-	}
 
 	retval = sd_set_clock_divider(chip, SD_CLK_DIVIDE_0);
-	if (retval != STATUS_SUCCESS) {
+	if (retval != STATUS_SUCCESS)
 		TRACE_RET(chip, STATUS_FAIL);
-	}
 
 	if (!(sd_card->raw_csd[4] & 0x40))
 		sd_dont_switch = 1;
@@ -2446,9 +2427,9 @@ SD_UNLOCK_ENTRY:
 		if (retval == STATUS_SUCCESS) {
 			retval = sd_switch_function(chip, switch_bus_width);
 			if (retval != STATUS_SUCCESS) {
-				if (CHECK_PID(chip, 0x5209)) {
+				if (CHECK_PID(chip, 0x5209))
 					sd_change_bank_voltage(chip, SD_IO_3V3);
-				}
+
 				sd_init_power(chip);
 				sd_dont_switch = 1;
 				try_sdio = 0;
@@ -2457,9 +2438,9 @@ SD_UNLOCK_ENTRY:
 			}
 		} else {
 			if (support_1v8) {
-				if (CHECK_PID(chip, 0x5209)) {
+				if (CHECK_PID(chip, 0x5209))
 					sd_change_bank_voltage(chip, SD_IO_3V3);
-				}
+
 				sd_init_power(chip);
 				sd_dont_switch = 1;
 				try_sdio = 0;
@@ -2471,13 +2452,12 @@ SD_UNLOCK_ENTRY:
 
 	if (!support_1v8) {
 		retval = sd_send_cmd_get_rsp(chip, APP_CMD, sd_card->sd_addr, SD_RSP_TYPE_R1, NULL, 0);
-		if (retval != STATUS_SUCCESS) {
+		if (retval != STATUS_SUCCESS)
 			TRACE_RET(chip, STATUS_FAIL);
-		}
+
 		retval = sd_send_cmd_get_rsp(chip, SET_BUS_WIDTH, 2, SD_RSP_TYPE_R1, NULL, 0);
-		if (retval != STATUS_SUCCESS) {
+		if (retval != STATUS_SUCCESS)
 			TRACE_RET(chip, STATUS_FAIL);
-		}
 	}
 
 #ifdef SUPPORT_SD_LOCK
@@ -2490,24 +2470,22 @@ SD_UNLOCK_ENTRY:
 		RTSX_WRITE_REG(chip, SD30_DRIVE_SEL, 0x07, chip->sd30_drive_sel_1v8);
 
 		retval = sd_set_init_para(chip);
-		if (retval != STATUS_SUCCESS) {
+		if (retval != STATUS_SUCCESS)
 			TRACE_RET(chip, STATUS_FAIL);
-		}
 
-		if (CHK_SD_DDR50(sd_card)) {
+		if (CHK_SD_DDR50(sd_card))
 			retval = sd_ddr_tuning(chip);
-		} else {
+		else
 			retval = sd_sdr_tuning(chip);
-		}
 
 		if (retval != STATUS_SUCCESS) {
 			if (sd20_mode) {
 				TRACE_RET(chip, STATUS_FAIL);
 			} else {
 				retval = sd_init_power(chip);
-				if (retval != STATUS_SUCCESS) {
+				if (retval != STATUS_SUCCESS)
 					TRACE_RET(chip, STATUS_FAIL);
-				}
+
 				try_sdio = 0;
 				sd20_mode = 1;
 				goto Switch_Fail;
@@ -2518,9 +2496,8 @@ SD_UNLOCK_ENTRY:
 
 		if (CHK_SD_DDR50(sd_card)) {
 			retval = sd_wait_state_data_ready(chip, 0x08, 1, 1000);
-			if (retval != STATUS_SUCCESS) {
+			if (retval != STATUS_SUCCESS)
 				read_lba0 = 0;
-			}
 		}
 
 		if (read_lba0) {
@@ -2530,9 +2507,9 @@ SD_UNLOCK_ENTRY:
 					TRACE_RET(chip, STATUS_FAIL);
 				} else {
 					retval = sd_init_power(chip);
-					if (retval != STATUS_SUCCESS) {
+					if (retval != STATUS_SUCCESS)
 						TRACE_RET(chip, STATUS_FAIL);
-					}
+
 					try_sdio = 0;
 					sd20_mode = 1;
 					goto Switch_Fail;
@@ -2542,9 +2519,8 @@ SD_UNLOCK_ENTRY:
 	}
 
 	retval = sd_check_wp_state(chip);
-	if (retval != STATUS_SUCCESS) {
+	if (retval != STATUS_SUCCESS)
 		TRACE_RET(chip, STATUS_FAIL);
-	}
 
 	chip->card_bus_width[chip->card2lun[SD_CARD]] = 4;
 
-- 
1.7.9.5


  parent reply	other threads:[~2012-09-07  4:35 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-01 13:43 [PATCH] staging/rts_pstor: remove braces {} in sd.c Toshiaki Yamane
2012-09-01 15:05 ` devendra.aaru
2012-09-02  0:55   ` Joe Perches
2012-09-02  9:03     ` devendra.aaru
2012-09-02  8:38   ` Toshiaki Yamane
2012-09-04 19:30 ` Greg Kroah-Hartman
2012-09-05  8:19   ` Toshiaki Yamane
2012-09-07  2:30   ` Toshiaki Yamane
2012-09-07  4:16 ` [PATCH 01/57] staging/rts_pstor: remove braces {} in sd.c (sd_send_cmd_get_rsp) Toshiaki Yamane
2012-09-07  4:22   ` [PATCH 02/57] staging/rts_pstor: remove braces {} in sd.c (sd_read_data) Toshiaki Yamane
2012-09-07  4:23   ` [PATCH 03/57] staging/rts_pstor: remove braces {} in sd.c (sd_write_data) Toshiaki Yamane
2012-09-07  4:23   ` [PATCH 04/57] staging/rts_pstor: remove braces {} in sd.c (sd_check_csd) Toshiaki Yamane
2012-09-07  4:23   ` [PATCH 05/57] staging/rts_pstor: remove braces {} in sd.c (sd_set_sample_push_timing) Toshiaki Yamane
2012-09-07  4:24   ` [PATCH 06/57] staging/rts_pstor: remove braces {} in sd.c (sd_choose_proper_clock) Toshiaki Yamane
2012-09-07  4:24   ` [PATCH 07/57] staging/rts_pstor: remove braces {} in sd.c (sd_set_clock_divider) Toshiaki Yamane
2012-09-07  4:25   ` [PATCH 08/57] staging/rts_pstor: remove braces {} in sd.c (sd_set_init_para) Toshiaki Yamane
2012-09-07  4:25   ` [PATCH 09/57] staging/rts_pstor: remove braces {} in sd.c (sd_select_card) Toshiaki Yamane
2012-09-07  4:26   ` [PATCH 10/57] staging/rts_pstor: remove braces {} in sd.c (sd_update_lock_status) Toshiaki Yamane
2012-09-07  4:26   ` [PATCH 11/57] staging/rts_pstor: remove braces {} in sd.c (sd_wait_state_data_ready) Toshiaki Yamane
2012-09-07  4:27   ` [PATCH 12/57] staging/rts_pstor: remove braces {} in sd.c (sd_change_bank_voltage) Toshiaki Yamane
2012-09-07  4:27   ` [PATCH 13/57] staging/rts_pstor: remove braces {} in sd.c (sd_voltage_switch) Toshiaki Yamane
2012-09-07  4:27   ` [PATCH 14/57] staging/rts_pstor: remove braces {} in sd.c (sd_change_phase) Toshiaki Yamane
2012-09-07  4:27   ` [PATCH 15/57] staging/rts_pstor: remove braces {} in sd.c (sd_check_spec) Toshiaki Yamane
2012-09-07  4:28   ` [PATCH 16/57] staging/rts_pstor: remove braces {} in sd.c (sd_check_switch_mode) Toshiaki Yamane
2012-09-07  4:28   ` [PATCH 17/57] staging/rts_pstor: remove braces {} in sd.c (downgrade_switch_mode) Toshiaki Yamane
2012-09-07  4:28   ` [PATCH 18/57] staging/rts_pstor: remove braces {} in sd.c (sd_check_switch) Toshiaki Yamane
2012-09-07  4:29   ` [PATCH 19/57] staging/rts_pstor: remove braces {} in sd.c (sd_switch_function) Toshiaki Yamane
2012-09-07  4:29   ` [PATCH 20/57] staging/rts_pstor: remove braces {} in sd.c (sd_sdr_tuning_rx_cmd) Toshiaki Yamane
2012-09-07  4:29   ` [PATCH 21/57] staging/rts_pstor: remove braces {} in sd.c (sd_ddr_tuning_rx_cmd) Toshiaki Yamane
2012-09-07  4:29   ` [PATCH 22/57] staging/rts_pstor: remove braces {} in sd.c (mmc_ddr_tunning_rx_cmd) Toshiaki Yamane
2012-09-07  4:30   ` [PATCH 23/57] staging/rts_pstor: remove braces {} in sd.c (sd_sdr_tuning_tx_cmd) Toshiaki Yamane
2012-09-07  4:30   ` [PATCH 24/57] staging/rts_pstor: remove braces {} in sd.c (sd_ddr_tuning_tx_cmd) Toshiaki Yamane
2012-09-07  4:30   ` [PATCH 25/57] staging/rts_pstor: remove braces {} in sd.c (sd_search_final_phase) Toshiaki Yamane
2012-09-07  4:30   ` [PATCH 26/57] staging/rts_pstor: remove braces {} in sd.c (sd_tuning_rx) Toshiaki Yamane
2012-09-07  4:31   ` [PATCH 27/57] staging/rts_pstor: remove braces {} in sd.c (sd_ddr_pre_tuning_tx) Toshiaki Yamane
2012-09-07  4:31   ` [PATCH 28/57] staging/rts_pstor: remove braces {} in sd.c (sd_tuning_tx) Toshiaki Yamane
2012-09-07  4:31   ` [PATCH 29/57] staging/rts_pstor: remove braces {} in sd.c (sd_sdr_tuning) Toshiaki Yamane
2012-09-07  4:32   ` [PATCH 30/57] staging/rts_pstor: remove braces {} in sd.c (sd_ddr_tuning) Toshiaki Yamane
2012-09-07  4:32   ` [PATCH 31/57] staging/rts_pstor: remove braces {} in sd.c (mmc_ddr_tuning) Toshiaki Yamane
2012-09-07  4:33   ` [PATCH 32/57] staging/rts_pstor: remove braces {} in sd.c (sd_switch_clock) Toshiaki Yamane
2012-09-07  4:33   ` [PATCH 33/57] staging/rts_pstor: remove braces {} in sd.c (sd_prepare_reset) Toshiaki Yamane
2012-09-07  4:34   ` [PATCH 34/57] staging/rts_pstor: remove braces {} in sd.c (sd_pull_ctl_enable) Toshiaki Yamane
2012-09-07  4:34   ` [PATCH 35/57] staging/rts_pstor: remove braces {} in sd.c (sd_init_power) Toshiaki Yamane
2012-09-07  4:34   ` [PATCH 36/57] staging/rts_pstor: remove braces {} in sd.c (sd_read_lba0) Toshiaki Yamane
2012-09-07  4:34   ` [PATCH 37/57] staging/rts_pstor: remove braces {} in sd.c (sd_check_wp_state) Toshiaki Yamane
2012-09-07  4:35   ` Toshiaki Yamane [this message]
2012-09-07  4:35   ` [PATCH 39/57] staging/rts_pstor: remove braces {} in sd.c (mmc_test_switch_bus) Toshiaki Yamane
2012-09-07  4:35   ` [PATCH 40/57] staging/rts_pstor: remove braces {} in sd.c (mmc_switch_timing_bus) Toshiaki Yamane
2012-09-07  4:35   ` [PATCH 41/57] staging/rts_pstor: remove braces {} in sd.c (reset_mmc) Toshiaki Yamane
2012-09-07  4:35   ` [PATCH 42/57] staging/rts_pstor: remove braces {} in sd.c (reset_sd_card) Toshiaki Yamane
2012-09-07  4:36   ` [PATCH 43/57] staging/rts_pstor: remove braces {} in sd.c (reset_mmc_only) Toshiaki Yamane
2012-09-07  4:36   ` [PATCH 44/57] staging/rts_pstor: remove braces {} in sd.c (wait_data_buf_ready) Toshiaki Yamane
2012-09-07  4:36   ` [PATCH 45/57] staging/rts_pstor: remove braces {} in sd.c (sd_stop_seq_mode) Toshiaki Yamane
2012-09-07  4:36   ` [PATCH 46/57] staging/rts_pstor: remove braces {} in sd.c (sd_auto_tune_clock) Toshiaki Yamane
2012-09-07  4:37   ` [PATCH 47/57] staging/rts_pstor: remove braces {} in sd.c (sd_rw) Toshiaki Yamane
2012-09-07  4:37   ` [PATCH 48/57] staging/rts_pstor: remove braces {} in sd.c (ext_sd_send_cmd_get_rsp) Toshiaki Yamane
2012-09-07  4:37   ` [PATCH 49/57] staging/rts_pstor: remove braces {} in sd.c (ext_sd_get_rsp) Toshiaki Yamane
2012-09-07  4:38   ` [PATCH 50/57] staging/rts_pstor: remove braces {} in sd.c (sd_pass_thru_mode) Toshiaki Yamane
2012-09-07  4:38   ` [PATCH 51/57] staging/rts_pstor: remove braces {} in sd.c (get_rsp_type) Toshiaki Yamane
2012-09-07  4:38   ` [PATCH 52/57] staging/rts_pstor: remove braces {} in sd.c (sd_execute_no_data) Toshiaki Yamane
2012-09-07  4:38   ` [PATCH 53/57] staging/rts_pstor: remove braces {} in sd.c (sd_execute_read_data) Toshiaki Yamane
2012-09-07  4:38   ` [PATCH 54/57] staging/rts_pstor: remove braces {} in sd.c (sd_execute_write_data) Toshiaki Yamane
2012-09-07  4:39   ` [PATCH 55/57] staging/rts_pstor: remove braces {} in sd.c (sd_hw_rst) Toshiaki Yamane
2012-09-07  4:39   ` [PATCH 56/57] staging/rts_pstor: remove braces {} in sd.c (sd_power_off_card3v3) Toshiaki Yamane
2012-09-07  4:39   ` [PATCH 57/57] staging/rts_pstor: remove braces {} in sd.c (release_sd_card) Toshiaki Yamane

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=1346992500-17609-1-git-send-email-yamanetoshi@gmail.com \
    --to=yamanetoshi@gmail.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®