# \[PATCH\] sm750fb: Fix C99 Comments and if else braces

- Subsystems: STAGING - SILICON MOTION SM750 FRAME BUFFER DRIVER, STAGING SUBSYSTEM, THE REST
- Maintainers: Sudip Mukherjee, Teddy Wang, Sudip Mukherjee, Greg Kroah-Hartman, Linus Torvalds
- List: linux-fbdev
- 3 messages, 3 authors
- Page: https://ratatoskr.run/linux-fbdev/2015/03/4455136/t

## \[PATCH\] sm750fb: Fix C99 Comments and if else braces

- From: Amitoj Kaur Chawla \<hidden\>
- Date: 2015-03-19 17:39:55 
- Message: https://ratatoskr.run/linux-fbdev/2015/03/4455136.md

```text
The edits have been made to remove C99 Comments and properly indent
the if-else statements in the file while taking care of the braces according to
Linux coding style.

Signed-off-by: Amitoj Kaur Chawla <redacted>
---
 drivers/staging/sm750fb/ddk750_chip.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
index 33add64..33fa456 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -17,25 +17,22 @@ logical_chip_type_t getChipType(void)
 	char physicalRev;
 	logical_chip_type_t chip;
 
-	physicalID = devId750;//either 0x718 or 0x750
+	physicalID = devId750;/* either 0x718 or 0x750 */
 	physicalRev = revId750;
 
-    if (physicalID = 0x718)
-    {
-        chip = SM718;
-    }
-    else if (physicalID = 0x750)
-    {
-        chip = SM750;
+	if (physicalID = 0x718) {
+		chip = SM718;
+	}
+	else if (physicalID = 0x750) {
+		chip = SM750;
 		/* SM750 and SM750LE are different in their revision ID only. */
-		if (physicalRev = SM750LE_REVISION_ID){
+		if (physicalRev = SM750LE_REVISION_ID) {
 			chip = SM750LE;
 		}
-    }
-    else
-    {
-        chip = SM_UNKNOWN;
-    }
+	}
+	else {
+		chip = SM_UNKNOWN;
+	}
 
 	return chip;
 }
-- 
1.9.1

```

## Re: \[PATCH\] sm750fb: Fix C99 Comments and if else braces

- From: Giedrius Statkevičius \<hidden\>
- Date: 2015-03-19 17:42:10 
- Message: https://ratatoskr.run/linux-fbdev/2015/03/4455140.md

```text
Hi Amitoj Kaur Chawla,

On 2015.03.19 19:39, Amitoj Kaur Chawla wrote:
> The edits have been made to remove C99 Comments and properly indent
> the if-else statements in the file while taking care of the braces according to
> Linux coding style.
> 
> Signed-off-by: Amitoj Kaur Chawla <redacted>
> ---
>  drivers/staging/sm750fb/ddk750_chip.c | 25 +++++++++++--------------
>  1 file changed, 11 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
> index 33add64..33fa456 100644
> --- a/drivers/staging/sm750fb/ddk750_chip.c
> +++ b/drivers/staging/sm750fb/ddk750_chip.c
> @@ -17,25 +17,22 @@ logical_chip_type_t getChipType(void)
>  	char physicalRev;
>  	logical_chip_type_t chip;
>  
> -	physicalID = devId750;//either 0x718 or 0x750
> +	physicalID = devId750;/* either 0x718 or 0x750 */

Add a space here after ;?

>  	physicalRev = revId750;
>  
> -    if (physicalID = 0x718)
> -    {
> -        chip = SM718;
> -    }
> -    else if (physicalID = 0x750)
> -    {
> -        chip = SM750;
> +	if (physicalID = 0x718) {
> +		chip = SM718;
> +	}
> +	else if (physicalID = 0x750) {
> +		chip = SM750;
>  		/* SM750 and SM750LE are different in their revision ID only. */
> -		if (physicalRev = SM750LE_REVISION_ID){
> +		if (physicalRev = SM750LE_REVISION_ID) {
>  			chip = SM750LE;
>  		}
> -    }
> -    else
> -    {
> -        chip = SM_UNKNOWN;
> -    }
> +	}
> +	else {
> +		chip = SM_UNKNOWN;
> +	}
>  
>  	return chip;
>  }
> 


-- 
Thanks,
Giedrius
```

## Re: \[PATCH\] sm750fb: Fix C99 Comments and if else braces

- From: Joe Perches \<joe@perches.com\>
- Date: 2015-03-19 18:06:17 
- Message: https://ratatoskr.run/linux-fbdev/2015/03/4455162.md

```text
On Thu, 2015-03-19 at 23:09 +0530, Amitoj Kaur Chawla wrote:
> The edits have been made to remove C99 Comments and properly indent
> the if-else statements in the file while taking care of the braces according to
> Linux coding style.

Please scan your proposed patches with checkpatch
and fix possible style defects before sending them.




```
