[PATCH 1/4] SM750FB: Fix bracket placement issue from checkpatch.pl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixed the issues with curly braces either needing to be on the line above or below in several files.

Signed-off-by: Daniel Lockyer <thisisdaniellockyer@xxxxxxxxx>
---
 drivers/staging/sm750fb/ddk750_display.c | 66 ++++++++++----------------------
 drivers/staging/sm750fb/ddk750_dvi.c     |  6 +--
 drivers/staging/sm750fb/ddk750_power.c   | 27 ++++---------
 drivers/staging/sm750fb/sm750_cursor.c   | 32 +++++-----------
 4 files changed, 41 insertions(+), 90 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c
index c84196a..0ad59eb 100644
--- a/drivers/staging/sm750fb/ddk750_display.c
+++ b/drivers/staging/sm750fb/ddk750_display.c
@@ -15,12 +15,10 @@ static void setDisplayControl(int ctrl,int dispState)
 	cnt = 0;
 
 	/* Set the primary display control */
-	if (!ctrl)
-	{
+	if (!ctrl) {
 		ulDisplayCtrlReg = PEEK32(PANEL_DISPLAY_CTRL);
 		/* Turn on/off the Panel display control */
-		if (dispState)
-		{
+		if (dispState) {
 			/* Timing should be enabled first before enabling the plane
 			 * because changing at the same time does not guarantee that
 			 * the plane will also enabled or disabled.
@@ -45,16 +43,13 @@ static void setDisplayControl(int ctrl,int dispState)
 			 * until a few delay. Need to write
 			 * and read it a couple times
 			 */
-			do
-			{
+			do {
 				cnt++;
 				POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg);
 			} while((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) !=
 					(ulDisplayCtrlReg & ~ulReservedBits));
 			printk("Set Panel Plane enbit:after tried %d times\n",cnt);
-		}
-		else
-		{
+		} else {
 			/* When turning off, there is no rule on the programming
 			 * sequence since whenever the clock is off, then it does not
 			 * matter whether the plane is enabled or disabled.
@@ -71,14 +66,11 @@ static void setDisplayControl(int ctrl,int dispState)
 			POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg);
 		}
 
-	}
+	} else {
 	/* Set the secondary display control */
-	else
-	{
 		ulDisplayCtrlReg = PEEK32(CRT_DISPLAY_CTRL);
 
-		if (dispState)
-		{
+		if (dispState) {
 			/* Timing should be enabled first before enabling the plane because changing at the
 			   same time does not guarantee that the plane will also enabled or disabled.
 			   */
@@ -100,16 +92,13 @@ static void setDisplayControl(int ctrl,int dispState)
 				FIELD_SET(0, CRT_DISPLAY_CTRL, RESERVED_3_MASK, ENABLE) |
 				FIELD_SET(0, CRT_DISPLAY_CTRL, RESERVED_4_MASK, ENABLE);
 
-			do
-			{
+			do {
 				cnt++;
 				POKE32(CRT_DISPLAY_CTRL, ulDisplayCtrlReg);
 			} while((PEEK32(CRT_DISPLAY_CTRL) & ~ulReservedBits) !=
 					(ulDisplayCtrlReg & ~ulReservedBits));
 				printk("Set Crt Plane enbit:after tried %d times\n",cnt);
-		}
-		else
-		{
+		} else {
 			/* When turning off, there is no rule on the programming
 			 * sequence since whenever the clock is off, then it does not
 			 * matter whether the plane is enabled or disabled.
@@ -140,30 +129,24 @@ static void waitNextVerticalSync(int ctrl,int delay)
 		if ((FIELD_GET(PEEK32(PANEL_PLL_CTRL), PANEL_PLL_CTRL, POWER) ==
 			 PANEL_PLL_CTRL_POWER_OFF) ||
 			(FIELD_GET(PEEK32(PANEL_DISPLAY_CTRL), PANEL_DISPLAY_CTRL, TIMING) ==
-			 PANEL_DISPLAY_CTRL_TIMING_DISABLE))
-		{
+			 PANEL_DISPLAY_CTRL_TIMING_DISABLE)) {
 			return;
 		}
 
-        while (delay-- > 0)
-        {
+        while (delay-- > 0) {
             /* Wait for end of vsync. */
-            do
-            {
+            do {
                 status = FIELD_GET(PEEK32(SYSTEM_CTRL),
                                    SYSTEM_CTRL,
                                    PANEL_VSYNC);
-            }
-            while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE);
+            } while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE);
 
             /* Wait for start of vsync. */
-            do
-            {
+            do {
                 status = FIELD_GET(PEEK32(SYSTEM_CTRL),
                                    SYSTEM_CTRL,
                                    PANEL_VSYNC);
-            }
-            while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE);
+            } while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE);
         }
 
 	}else{
@@ -173,30 +156,24 @@ static void waitNextVerticalSync(int ctrl,int delay)
 		if ((FIELD_GET(PEEK32(CRT_PLL_CTRL), CRT_PLL_CTRL, POWER) ==
 			 CRT_PLL_CTRL_POWER_OFF) ||
 			(FIELD_GET(PEEK32(CRT_DISPLAY_CTRL), CRT_DISPLAY_CTRL, TIMING) ==
-			 CRT_DISPLAY_CTRL_TIMING_DISABLE))
-		{
+			 CRT_DISPLAY_CTRL_TIMING_DISABLE)) {
 			return;
 		}
 
-		while (delay-- > 0)
-		{
+		while (delay-- > 0) {
 			/* Wait for end of vsync. */
-			do
-			{
+			do {
 				status = FIELD_GET(PEEK32(SYSTEM_CTRL),
 								   SYSTEM_CTRL,
 								   CRT_VSYNC);
-			}
-			while (status == SYSTEM_CTRL_CRT_VSYNC_ACTIVE);
+			} while (status == SYSTEM_CTRL_CRT_VSYNC_ACTIVE);
 
 			/* Wait for start of vsync. */
-			do
-			{
+			do {
 				status = FIELD_GET(PEEK32(SYSTEM_CTRL),
 								   SYSTEM_CTRL,
 								   CRT_VSYNC);
-			}
-			while (status == SYSTEM_CTRL_CRT_VSYNC_INACTIVE);
+			} while (status == SYSTEM_CTRL_CRT_VSYNC_INACTIVE);
 		}
 	}
 }
@@ -293,8 +270,7 @@ int ddk750_initDVIDisp(void)
                 1,  /* Enable continuous Sync */
                 1,  /* Enable PLL Filter */
                 4   /* Use the recommended value for PLL Filter value */
-        ) != 0) && (dviGetVendorID() != 0x0000) && (dviGetDeviceID() != 0x0000))
-    {
+        ) != 0) && (dviGetVendorID() != 0x0000) && (dviGetDeviceID() != 0x0000)) {
         return (-1);
     }
 
diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c
index f5932bb..8a37ce9 100644
--- a/drivers/staging/sm750fb/ddk750_dvi.c
+++ b/drivers/staging/sm750fb/ddk750_dvi.c
@@ -9,8 +9,7 @@
 /* This global variable contains all the supported driver and its corresponding
    function API. Please set the function pointer to NULL whenever the function
    is not supported. */
-static dvi_ctrl_device_t g_dcftSupportedDviController[] =
-{
+static dvi_ctrl_device_t g_dcftSupportedDviController[] = {
 #ifdef DVI_CTRL_SII164
     {
         .pfnInit = sii164InitChip,
@@ -45,8 +44,7 @@ int dviInit(
 {
 	dvi_ctrl_device_t *pCurrentDviCtrl;
 	pCurrentDviCtrl = g_dcftSupportedDviController;
-	if(pCurrentDviCtrl->pfnInit != NULL)
-	{
+	if (pCurrentDviCtrl->pfnInit != NULL) {
 		return pCurrentDviCtrl->pfnInit(edgeSelect, busSelect, dualEdgeClkSelect, hsyncEnable,
                               vsyncEnable, deskewEnable, deskewSetting, continuousSyncEnable,
                               pllFilterEnable, pllFilterValue);
diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c
index cbb9767..fcc1317 100644
--- a/drivers/staging/sm750fb/ddk750_power.c
+++ b/drivers/staging/sm750fb/ddk750_power.c
@@ -36,8 +36,7 @@ void setPowerMode(unsigned int powerMode)
 	if(getChipType() == SM750LE)
 		return;
 
-    switch (powerMode)
-    {
+	switch (powerMode) {
         case POWER_MODE_CTRL_MODE_MODE0:
             control_value = FIELD_SET(control_value, POWER_MODE_CTRL, MODE, MODE0);
             break;
@@ -55,16 +54,13 @@ void setPowerMode(unsigned int powerMode)
     }
 
     /* Set up other fields in Power Control Register */
-    if (powerMode == POWER_MODE_CTRL_MODE_SLEEP)
-    {
+    if (powerMode == POWER_MODE_CTRL_MODE_SLEEP) {
         control_value =
 #ifdef VALIDATION_CHIP
             FIELD_SET(  control_value, POWER_MODE_CTRL, 336CLK, OFF) |
 #endif
             FIELD_SET(  control_value, POWER_MODE_CTRL, OSC_INPUT,  OFF);
-    }
-    else
-    {
+    } else {
         control_value =
 #ifdef VALIDATION_CHIP
             FIELD_SET(  control_value, POWER_MODE_CTRL, 336CLK, ON) |
@@ -84,8 +80,7 @@ void setCurrentGate(unsigned int gate)
     /* Get current power mode. */
     mode = getPowerMode();
 
-    switch (mode)
-    {
+    switch (mode) {
         case POWER_MODE_CTRL_MODE_MODE0:
             gate_reg = MODE0_GATE;
             break;
@@ -111,13 +106,10 @@ void enable2DEngine(unsigned int enable)
     uint32_t gate;
 
     gate = PEEK32(CURRENT_GATE);
-    if (enable)
-    {
+    if (enable) {
         gate = FIELD_SET(gate, CURRENT_GATE, DE,  ON);
         gate = FIELD_SET(gate, CURRENT_GATE, CSC, ON);
-    }
-    else
-    {
+    } else {
         gate = FIELD_SET(gate, CURRENT_GATE, DE,  OFF);
         gate = FIELD_SET(gate, CURRENT_GATE, CSC, OFF);
     }
@@ -135,8 +127,7 @@ void enableZVPort(unsigned int enable)
 
     /* Enable ZV Port Gate */
     gate = PEEK32(CURRENT_GATE);
-    if (enable)
-    {
+    if (enable) {
         gate = FIELD_SET(gate, CURRENT_GATE, ZVPORT, ON);
 #if 1
         /* Using Software I2C */
@@ -145,9 +136,7 @@ void enableZVPort(unsigned int enable)
         /* Using Hardware I2C */
         gate = FIELD_SET(gate, CURRENT_GATE, I2C,    ON);
 #endif
-    }
-    else
-    {
+    } else {
         /* Disable ZV Port Gate. There is no way to know whether the GPIO pins are being used
            or not. Therefore, do not disable the GPIO gate. */
         gate = FIELD_SET(gate, CURRENT_GATE, ZVPORT, OFF);
diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c
index 68d5cbc..b20e1f8 100644
--- a/drivers/staging/sm750fb/sm750_cursor.c
+++ b/drivers/staging/sm750fb/sm750_cursor.c
@@ -122,8 +122,7 @@ void hw_cursor_setData(struct lynx_cursor * cursor,
 		odd=0;
 */
 
-	for(i=0;i<count;i++)
-	{
+	for (i = 0; i < count; i++) {
 		color = *pcol++;
 		mask = *pmsk++;
 		data = 0;
@@ -137,11 +136,9 @@ void hw_cursor_setData(struct lynx_cursor * cursor,
 		else
 			opr = mask & color;
 
-		for(j=0;j<8;j++)
-		{
+		for (j = 0; j < 8; j++) {
 
-			if(opr & (0x80 >> j))
-			{	//use fg color,id = 2
+			if (opr & (0x80 >> j)) {
 				data |= 2 << (j*2);
 			}else{
 				//use bg color,id = 1
@@ -149,7 +146,7 @@ void hw_cursor_setData(struct lynx_cursor * cursor,
 			}
 		}
 #else
-		for(j=0;j<8;j++){
+		for (j = 0; j < 8; j++) {
 			if(mask & (0x80>>j)){
 				if(rop == ROP_XOR)
 					opr = mask ^ color;
@@ -164,12 +161,7 @@ void hw_cursor_setData(struct lynx_cursor * cursor,
 		iowrite16(data, pbuffer);
 
 		/* assume pitch is 1,2,4,8,...*/
-#if 0
-		if(!((i+1)&(pitch-1)))   /* below line equal to is line */
-#else
-		if((i+1) % pitch == 0)
-#endif
-		{
+		if ((i+1) % pitch == 0) {
 			/* need a return */
 			pstart += offset;
 			pbuffer = pstart;
@@ -204,8 +196,7 @@ void hw_cursor_setData2(struct lynx_cursor * cursor,
 	pstart = cursor->vstart;
 	pbuffer = pstart;
 
-	for(i=0;i<count;i++)
-	{
+	for (i = 0; i < count; i++) {
 		color = *pcol++;
 		mask = *pmsk++;
 		data = 0;
@@ -217,11 +208,10 @@ void hw_cursor_setData2(struct lynx_cursor * cursor,
 		else
 			opr = mask & color;
 
-		for(j=0;j<8;j++)
-		{
+		for (j = 0; j < 8; j++) {
 
-			if(opr & (0x80 >> j))
-			{	//use fg color,id = 2
+			if (opr & (0x80 >> j)) {
+				/* use fg color,id = 2 */
 				data |= 2 << (j*2);
 			}else{
 				//use bg color,id = 1
@@ -237,9 +227,7 @@ void hw_cursor_setData2(struct lynx_cursor * cursor,
 		iowrite16(data, pbuffer);
 
 		/* assume pitch is 1,2,4,8,...*/
-		if(!(i&(pitch-1)))
-		//if((i+1) % pitch == 0)
-		{
+		if (!(i&(pitch-1))) {
 			/* need a return */
 			pstart += offset;
 			pbuffer = pstart;
-- 
2.4.2

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux