public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rts5208: ensure braces on all arms of if stmt
@ 2016-04-05 16:29 Nicholas Sim
  2016-04-06 12:32 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Sim @ 2016-04-05 16:29 UTC (permalink / raw)
  To: gregkh, devel; +Cc: linux-kernel

Added braces on if arm of if statement where else arm already needs braces
as suggested for clarity in Documentation/CodingStyle

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
---
 drivers/staging/rts5208/ms.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c
index 3e75db7..2ad4ea0 100644
--- a/drivers/staging/rts5208/ms.c
+++ b/drivers/staging/rts5208/ms.c
@@ -794,8 +794,9 @@ static int ms_confirm_cpu_startup(struct rtsx_chip *chip)
 	}
 
 	if (val & INT_REG_ERR) {
-		if (val & INT_REG_CMDNK)
+		if (val & INT_REG_CMDNK) {
 			chip->card_wp |= (MS_CARD);
+		}
 		else {
 			rtsx_trace(chip);
 			return STATUS_FAIL;
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] staging: rts5208: ensure braces on all arms of if stmt
@ 2016-04-05 16:47 Nicholas Sim
  0 siblings, 0 replies; 3+ messages in thread
From: Nicholas Sim @ 2016-04-05 16:47 UTC (permalink / raw)
  To: gregkh, devel; +Cc: linux-kernel

Added braces on if arm of if statement where else arm already needs
braces as suggested for clarity in Documentation/CodingStyle (several)

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
---
 drivers/staging/rts5208/sd.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
index 87d6976..6219e04 100644
--- a/drivers/staging/rts5208/sd.c
+++ b/drivers/staging/rts5208/sd.c
@@ -1928,9 +1928,9 @@ static int sd_tuning_rx(struct rtsx_chip *chip)
 			tuning_cmd = sd_sdr_tuning_rx_cmd;
 
 	} else {
-		if (CHK_MMC_DDR52(sd_card))
+		if (CHK_MMC_DDR52(sd_card)) {
 			tuning_cmd = mmc_ddr_tunning_rx_cmd;
-		else {
+		} else {
 			rtsx_trace(chip);
 			return STATUS_FAIL;
 		}
@@ -2054,9 +2054,9 @@ static int sd_tuning_tx(struct rtsx_chip *chip)
 			tuning_cmd = sd_sdr_tuning_tx_cmd;
 
 	} else {
-		if (CHK_MMC_DDR52(sd_card))
+		if (CHK_MMC_DDR52(sd_card)) {
 			tuning_cmd = sd_ddr_tuning_tx_cmd;
-		else {
+		} else {
 			rtsx_trace(chip);
 			return STATUS_FAIL;
 		}
@@ -2678,9 +2678,9 @@ RTY_SD_RST:
 			}
 
 			j++;
-			if (j < 3)
+			if (j < 3) {
 				goto RTY_SD_RST;
-			else {
+			} else {
 				rtsx_trace(chip);
 				return STATUS_FAIL;
 			}
@@ -2690,9 +2690,9 @@ RTY_SD_RST:
 					SD_RSP_TYPE_R3, rsp, 5);
 		if (retval != STATUS_SUCCESS) {
 			k++;
-			if (k < 3)
+			if (k < 3) {
 				goto RTY_SD_RST;
-			else {
+			} else {
 				rtsx_trace(chip);
 				return STATUS_FAIL;
 			}
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: rts5208: ensure braces on all arms of if stmt
  2016-04-05 16:29 [PATCH] staging: rts5208: ensure braces on all arms of if stmt Nicholas Sim
@ 2016-04-06 12:32 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-04-06 12:32 UTC (permalink / raw)
  To: Nicholas Sim; +Cc: gregkh, devel, linux-kernel

On Tue, Apr 05, 2016 at 05:29:17PM +0100, Nicholas Sim wrote:
> Added braces on if arm of if statement where else arm already needs braces
> as suggested for clarity in Documentation/CodingStyle
> 
> Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
> ---
>  drivers/staging/rts5208/ms.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c
> index 3e75db7..2ad4ea0 100644
> --- a/drivers/staging/rts5208/ms.c
> +++ b/drivers/staging/rts5208/ms.c
> @@ -794,8 +794,9 @@ static int ms_confirm_cpu_startup(struct rtsx_chip *chip)
>  	}
>  
>  	if (val & INT_REG_ERR) {
> -		if (val & INT_REG_CMDNK)
> +		if (val & INT_REG_CMDNK) {
>  			chip->card_wp |= (MS_CARD);
> +		}
>  		else {

It should be } else { on one line.

regards,
dan carpenter
 http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-06 12:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-05 16:29 [PATCH] staging: rts5208: ensure braces on all arms of if stmt Nicholas Sim
2016-04-06 12:32 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2016-04-05 16:47 Nicholas Sim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox