[PATCH] staging: rts5208: use temporary variable for readability

Gujulan Elango, Hari Prasath (H.) hgujulan at visteon.com
Fri May 15 12:09:42 UTC 2015


Use a temporary value to hold the SD lock status thereby making the code
readable.This also fixes a coding style violation with the braces around
the if block.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan at visteon.com>
---
 drivers/staging/rts5208/sd.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
index a8d657b..2eff625 100644
--- a/drivers/staging/rts5208/sd.c
+++ b/drivers/staging/rts5208/sd.c
@@ -237,6 +237,7 @@ RTY_SEND_CMD:
 	}
 
 	if ((rsp_type == SD_RSP_TYPE_R1) || (rsp_type == SD_RSP_TYPE_R1b)) {
+		u8 sd_lock_status;
 		if ((cmd_idx != SEND_RELATIVE_ADDR) &&
 			(cmd_idx != SEND_IF_COND)) {
 			if (cmd_idx != STOP_TRANSMISSION) {
@@ -246,11 +247,11 @@ RTY_SEND_CMD:
 				}
 			}
 #ifdef SUPPORT_SD_LOCK
-			if (ptr[1] & 0x7D)
+			sd_lock_status = 0x7D;
 #else
-			if (ptr[1] & 0x7F)
+			sd_lock_status = 0x7F;
 #endif
-			{
+			if (ptr[1] & sd_lock_status) {
 				dev_dbg(rtsx_dev(chip), "ptr[1]: 0x%02x\n",
 					ptr[1]);
 				rtsx_trace(chip);
-- 
1.9.1


More information about the devel mailing list