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>] [day] [month] [year] [list]
Message-Id: <1346334311-20771-1-git-send-email-yamanetoshi@gmail.com>
Date:	Thu, 30 Aug 2012 22:45:11 +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] staging/rts_pstor: remove braces {} in rtsx_transport.c

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

Signed-off-by: Toshiaki Yamane <yamanetoshi@...il.com>
---
 drivers/staging/rts_pstor/rtsx_transport.c |  100 +++++++++++++---------------
 1 file changed, 45 insertions(+), 55 deletions(-)

diff --git a/drivers/staging/rts_pstor/rtsx_transport.c b/drivers/staging/rts_pstor/rtsx_transport.c
index 54a4742..1f9a424 100644
--- a/drivers/staging/rts_pstor/rtsx_transport.c
+++ b/drivers/staging/rts_pstor/rtsx_transport.c
@@ -218,9 +218,9 @@ void rtsx_add_cmd(struct rtsx_chip *chip,
 	val |= (u32)data;
 
 	spin_lock_irq(&chip->rtsx->reg_lock);
-	if (chip->ci < (HOST_CMDS_BUF_LEN / 4)) {
+	if (chip->ci < (HOST_CMDS_BUF_LEN / 4))
 		cb[(chip->ci)++] = cpu_to_le32(val);
-	}
+
 	spin_unlock_irq(&chip->rtsx->reg_lock);
 }
 
@@ -244,15 +244,14 @@ int rtsx_send_cmd(struct rtsx_chip *chip, u8 card, int timeout)
 	long timeleft;
 	int err = 0;
 
-	if (card == SD_CARD) {
+	if (card == SD_CARD)
 		rtsx->check_card_cd = SD_EXIST;
-	} else if (card == MS_CARD) {
+	else if (card == MS_CARD)
 		rtsx->check_card_cd = MS_EXIST;
-	} else if (card == XD_CARD) {
+	else if (card == XD_CARD)
 		rtsx->check_card_cd = XD_EXIST;
-	} else {
+	else
 		rtsx->check_card_cd = 0;
-	}
 
 	spin_lock_irq(&rtsx->reg_lock);
 
@@ -281,11 +280,11 @@ int rtsx_send_cmd(struct rtsx_chip *chip, u8 card, int timeout)
 	}
 
 	spin_lock_irq(&rtsx->reg_lock);
-	if (rtsx->trans_result == TRANS_RESULT_FAIL) {
+	if (rtsx->trans_result == TRANS_RESULT_FAIL)
 		err = -EIO;
-	} else if (rtsx->trans_result == TRANS_RESULT_OK) {
+	else if (rtsx->trans_result == TRANS_RESULT_OK)
 		err = 0;
-	}
+
 	spin_unlock_irq(&rtsx->reg_lock);
 
 finish_send_cmd:
@@ -341,23 +340,21 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card,
 	if ((sg == NULL) || (num_sg <= 0) || !offset || !index)
 		return -EIO;
 
-	if (dma_dir == DMA_TO_DEVICE) {
+	if (dma_dir == DMA_TO_DEVICE)
 		dir = HOST_TO_DEVICE;
-	} else if (dma_dir == DMA_FROM_DEVICE) {
+	else if (dma_dir == DMA_FROM_DEVICE)
 		dir = DEVICE_TO_HOST;
-	} else {
+	else
 		return -ENXIO;
-	}
 
-	if (card == SD_CARD) {
+	if (card == SD_CARD)
 		rtsx->check_card_cd = SD_EXIST;
-	} else if (card == MS_CARD) {
+	else if (card == MS_CARD)
 		rtsx->check_card_cd = MS_EXIST;
-	} else if (card == XD_CARD) {
+	else if (card == XD_CARD)
 		rtsx->check_card_cd = XD_EXIST;
-	} else {
+	else
 		rtsx->check_card_cd = 0;
-	}
 
 	spin_lock_irq(&rtsx->reg_lock);
 
@@ -405,11 +402,10 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card,
 			*offset = 0;
 			*index = *index + 1;
 		}
-		if ((i == (sg_cnt - 1)) || !resid) {
+		if ((i == (sg_cnt - 1)) || !resid)
 			option = SG_VALID | SG_END | SG_TRANS_DATA;
-		} else {
+		else
 			option = SG_VALID | SG_TRANS_DATA;
-		}
 
 		rtsx_add_sg_tbl(chip, (u32)addr, (u32)len, option);
 
@@ -468,11 +464,11 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card,
 	}
 
 	spin_lock_irq(&rtsx->reg_lock);
-	if (rtsx->trans_result == TRANS_RESULT_FAIL) {
+	if (rtsx->trans_result == TRANS_RESULT_FAIL)
 		err = -EIO;
-	} else if (rtsx->trans_result == TRANS_RESULT_OK) {
+	else if (rtsx->trans_result == TRANS_RESULT_OK)
 		err = 0;
-	}
+
 	spin_unlock_irq(&rtsx->reg_lock);
 
 out:
@@ -501,23 +497,21 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip *chip, u8 card,
 	if ((sg == NULL) || (num_sg <= 0))
 		return -EIO;
 
-	if (dma_dir == DMA_TO_DEVICE) {
+	if (dma_dir == DMA_TO_DEVICE)
 		dir = HOST_TO_DEVICE;
-	} else if (dma_dir == DMA_FROM_DEVICE) {
+	else if (dma_dir == DMA_FROM_DEVICE)
 		dir = DEVICE_TO_HOST;
-	} else {
+	else
 		return -ENXIO;
-	}
 
-	if (card == SD_CARD) {
+	if (card == SD_CARD)
 		rtsx->check_card_cd = SD_EXIST;
-	} else if (card == MS_CARD) {
+	else if (card == MS_CARD)
 		rtsx->check_card_cd = MS_EXIST;
-	} else if (card == XD_CARD) {
+	else if (card == XD_CARD)
 		rtsx->check_card_cd = XD_EXIST;
-	} else {
+	else
 		rtsx->check_card_cd = 0;
-	}
 
 	spin_lock_irq(&rtsx->reg_lock);
 
@@ -537,11 +531,10 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip *chip, u8 card,
 		u32 val = TRIG_DMA;
 		int sg_cnt, j;
 
-		if (i == buf_cnt / (HOST_SG_TBL_BUF_LEN / 8)) {
+		if (i == buf_cnt / (HOST_SG_TBL_BUF_LEN / 8))
 			sg_cnt = buf_cnt % (HOST_SG_TBL_BUF_LEN / 8);
-		} else {
+		else
 			sg_cnt = (HOST_SG_TBL_BUF_LEN / 8);
-		}
 
 		chip->sgi = 0;
 		for (j = 0; j < sg_cnt; j++) {
@@ -552,11 +545,10 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip *chip, u8 card,
 			RTSX_DEBUGP("DMA addr: 0x%x, Len: 0x%x\n",
 				     (unsigned int)addr, len);
 
-			if (j == (sg_cnt - 1)) {
+			if (j == (sg_cnt - 1))
 				option = SG_VALID | SG_END | SG_TRANS_DATA;
-			} else {
+			else
 				option = SG_VALID | SG_TRANS_DATA;
-			}
 
 			rtsx_add_sg_tbl(chip, (u32)addr, (u32)len, option);
 
@@ -615,11 +607,11 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip *chip, u8 card,
 	}
 
 	spin_lock_irq(&rtsx->reg_lock);
-	if (rtsx->trans_result == TRANS_RESULT_FAIL) {
+	if (rtsx->trans_result == TRANS_RESULT_FAIL)
 		err = -EIO;
-	} else if (rtsx->trans_result == TRANS_RESULT_OK) {
+	else if (rtsx->trans_result == TRANS_RESULT_OK)
 		err = 0;
-	}
+
 	spin_unlock_irq(&rtsx->reg_lock);
 
 out:
@@ -647,27 +639,25 @@ static int rtsx_transfer_buf(struct rtsx_chip *chip, u8 card, void *buf, size_t
 	if ((buf == NULL) || (len <= 0))
 		return -EIO;
 
-	if (dma_dir == DMA_TO_DEVICE) {
+	if (dma_dir == DMA_TO_DEVICE)
 		dir = HOST_TO_DEVICE;
-	} else if (dma_dir == DMA_FROM_DEVICE) {
+	else if (dma_dir == DMA_FROM_DEVICE)
 		dir = DEVICE_TO_HOST;
-	} else {
+	else
 		return -ENXIO;
-	}
 
 	addr = dma_map_single(&(rtsx->pci->dev), buf, len, dma_dir);
 	if (!addr)
 		return -ENOMEM;
 
-	if (card == SD_CARD) {
+	if (card == SD_CARD)
 		rtsx->check_card_cd = SD_EXIST;
-	} else if (card == MS_CARD) {
+	else if (card == MS_CARD)
 		rtsx->check_card_cd = MS_EXIST;
-	} else if (card == XD_CARD) {
+	else if (card == XD_CARD)
 		rtsx->check_card_cd = XD_EXIST;
-	} else {
+	else
 		rtsx->check_card_cd = 0;
-	}
 
 	val |= (u32)(dir & 0x01) << 29;
 	val |= (u32)(len & 0x00FFFFFF);
@@ -698,11 +688,11 @@ static int rtsx_transfer_buf(struct rtsx_chip *chip, u8 card, void *buf, size_t
 	}
 
 	spin_lock_irq(&rtsx->reg_lock);
-	if (rtsx->trans_result == TRANS_RESULT_FAIL) {
+	if (rtsx->trans_result == TRANS_RESULT_FAIL)
 		err = -EIO;
-	} else if (rtsx->trans_result == TRANS_RESULT_OK) {
+	else if (rtsx->trans_result == TRANS_RESULT_OK)
 		err = 0;
-	}
+
 	spin_unlock_irq(&rtsx->reg_lock);
 
 out:
-- 
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