lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri,  7 Sep 2012 13:29:00 +0900
From:	Toshiaki Yamane <yamanetoshi@...il.com>
To:	Greg Kroah-Hartman <greg@...ah.com>
Cc:	linux-kernel@...r.kernel.org,
	Toshiaki Yamane <yamanetoshi@...il.com>
Subject: [PATCH 19/57] staging/rts_pstor: remove braces {} in sd.c (sd_switch_function)

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@...il.com>
---
 drivers/staging/rts_pstor/sd.c |   48 ++++++++++++++++++----------------------
 1 file changed, 21 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/rts_pstor/sd.c b/drivers/staging/rts_pstor/sd.c
index c90deb6..558f25b3 100644
--- a/drivers/staging/rts_pstor/sd.c
+++ b/drivers/staging/rts_pstor/sd.c
@@ -1224,9 +1224,8 @@ static int sd_switch_function(struct rtsx_chip *chip, u8 bus_width)
 	/* Get supported functions */
 	retval = sd_check_switch_mode(chip, SD_CHECK_MODE,
 			NO_ARGUMENT, NO_ARGUMENT, bus_width);
-	if (retval != STATUS_SUCCESS) {
+	if (retval != STATUS_SUCCESS)
 		TRACE_RET(chip, STATUS_FAIL);
-	}
 
 	sd_card->func_group1_mask &= ~(sd_card->sd_switch_fail);
 
@@ -1255,9 +1254,9 @@ static int sd_switch_function(struct rtsx_chip *chip, u8 bus_width)
 			break;
 
 		case HS_SUPPORT:
-			if (sd_card->func_group1_mask & HS_SUPPORT_MASK) {
+			if (sd_card->func_group1_mask & HS_SUPPORT_MASK)
 				func_to_switch = HS_SUPPORT;
-			}
+
 			break;
 
 		default:
@@ -1265,9 +1264,9 @@ static int sd_switch_function(struct rtsx_chip *chip, u8 bus_width)
 		}
 
 
-		if (func_to_switch) {
+		if (func_to_switch)
 			break;
-		}
+
 	}
 	RTSX_DEBUGP("SD_FUNC_GROUP_1: func_to_switch = 0x%02x", func_to_switch);
 
@@ -1296,23 +1295,21 @@ static int sd_switch_function(struct rtsx_chip *chip, u8 bus_width)
 			TRACE_RET(chip, STATUS_FAIL);
 		}
 
-		if (func_to_switch == SDR104_SUPPORT) {
+		if (func_to_switch == SDR104_SUPPORT)
 			SET_SD_SDR104(sd_card);
-		} else if (func_to_switch == DDR50_SUPPORT) {
+		else if (func_to_switch == DDR50_SUPPORT)
 			SET_SD_DDR50(sd_card);
-		} else if (func_to_switch == SDR50_SUPPORT) {
+		else if (func_to_switch == SDR50_SUPPORT)
 			SET_SD_SDR50(sd_card);
-		} else {
+		else
 			SET_SD_HS(sd_card);
-		}
 	}
 
 	if (CHK_SD_DDR50(sd_card)) {
 		RTSX_WRITE_REG(chip, SD_PUSH_POINT_CTL, 0x06, 0x04);
 		retval = sd_set_sample_push_timing(chip);
-		if (retval != STATUS_SUCCESS) {
+		if (retval != STATUS_SUCCESS)
 			TRACE_RET(chip, STATUS_FAIL);
-		}
 	}
 
 	if (!func_to_switch || (func_to_switch == HS_SUPPORT)) {
@@ -1328,36 +1325,35 @@ static int sd_switch_function(struct rtsx_chip *chip, u8 bus_width)
 	for (i = 0; i < 4; i++) {
 		switch ((u8)(chip->sd_current_prior >> (i*8))) {
 		case CURRENT_LIMIT_800:
-			if (sd_card->func_group4_mask & CURRENT_LIMIT_800_MASK) {
+			if (sd_card->func_group4_mask & CURRENT_LIMIT_800_MASK)
 				func_to_switch = CURRENT_LIMIT_800;
-			}
+
 			break;
 
 		case CURRENT_LIMIT_600:
-			if (sd_card->func_group4_mask & CURRENT_LIMIT_600_MASK) {
+			if (sd_card->func_group4_mask & CURRENT_LIMIT_600_MASK)
 				func_to_switch = CURRENT_LIMIT_600;
-			}
+
 			break;
 
 		case CURRENT_LIMIT_400:
-			if (sd_card->func_group4_mask & CURRENT_LIMIT_400_MASK) {
+			if (sd_card->func_group4_mask & CURRENT_LIMIT_400_MASK)
 				func_to_switch = CURRENT_LIMIT_400;
-			}
+
 			break;
 
 		case CURRENT_LIMIT_200:
-			if (sd_card->func_group4_mask & CURRENT_LIMIT_200_MASK) {
+			if (sd_card->func_group4_mask & CURRENT_LIMIT_200_MASK)
 				func_to_switch = CURRENT_LIMIT_200;
-			}
+
 			break;
 
 		default:
 			continue;
 		}
 
-		if (func_to_switch != 0xFF) {
+		if (func_to_switch != 0xFF)
 			break;
-		}
 	}
 
 	RTSX_DEBUGP("SD_FUNC_GROUP_4: func_to_switch = 0x%02x", func_to_switch);
@@ -1365,16 +1361,14 @@ static int sd_switch_function(struct rtsx_chip *chip, u8 bus_width)
 	if (func_to_switch <= CURRENT_LIMIT_800) {
 		retval = sd_check_switch(chip, SD_FUNC_GROUP_4, func_to_switch, bus_width);
 		if (retval != STATUS_SUCCESS) {
-			if (sd_check_err_code(chip, SD_NO_CARD)) {
+			if (sd_check_err_code(chip, SD_NO_CARD))
 				TRACE_RET(chip, STATUS_FAIL);
-			}
 		}
 		RTSX_DEBUGP("Switch current limit finished! (%d)\n", retval);
 	}
 
-	if (CHK_SD_DDR50(sd_card)) {
+	if (CHK_SD_DDR50(sd_card))
 		RTSX_WRITE_REG(chip, SD_PUSH_POINT_CTL, 0x06, 0);
-	}
 
 	return STATUS_SUCCESS;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ