[PATCH 2/4] SM750FB: Fix spacing issues from checkpatch.pl

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

 



This patch fixes spacing issues reported from checkpatch.pl. These include:
* between a C keyword and the next character ( "if(" => "if (" )
* between a comma and the next character
* between a * and the next character

Signed-off-by: Daniel Lockyer <thisisdaniellockyer@xxxxxxxxx>
---
 drivers/staging/sm750fb/ddk750_display.c | 58 ++++++++++++-------------
 drivers/staging/sm750fb/ddk750_dvi.c     |  2 +-
 drivers/staging/sm750fb/ddk750_help.c    |  6 +--
 drivers/staging/sm750fb/ddk750_power.c   | 51 +++++++++++-----------
 drivers/staging/sm750fb/sm750_cursor.c   | 74 ++++++++++++++++----------------
 5 files changed, 94 insertions(+), 97 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c
index 0ad59eb..656fa4d 100644
--- a/drivers/staging/sm750fb/ddk750_display.c
+++ b/drivers/staging/sm750fb/ddk750_display.c
@@ -4,9 +4,9 @@
 #include "ddk750_power.h"
 #include "ddk750_dvi.h"
 
-#define primaryWaitVerticalSync(delay) waitNextVerticalSync(0,delay)
+#define primaryWaitVerticalSync(delay) waitNextVerticalSync(0, delay)
 
-static void setDisplayControl(int ctrl,int dispState)
+static void setDisplayControl(int ctrl, int dispState)
 {
 	/* state != 0 means turn on both timing & plane en_bit */
 	unsigned long ulDisplayCtrlReg, ulReservedBits;
@@ -48,7 +48,7 @@ static void setDisplayControl(int ctrl,int dispState)
 				POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg);
 			} while((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) !=
 					(ulDisplayCtrlReg & ~ulReservedBits));
-			printk("Set Panel Plane enbit:after tried %d times\n",cnt);
+			printk("Set Panel Plane enbit:after tried %d times\n", cnt);
 		} else {
 			/* When turning off, there is no rule on the programming
 			 * sequence since whenever the clock is off, then it does not
@@ -121,7 +121,7 @@ static void setDisplayControl(int ctrl,int dispState)
 static void waitNextVerticalSync(int ctrl,int delay)
 {
 	unsigned int status;
-	if(!ctrl){
+	if (!ctrl) {
 		/* primary controller */
 
         /* Do not wait when the Primary PLL is off or display control is already off.
@@ -149,7 +149,7 @@ static void waitNextVerticalSync(int ctrl,int delay)
             } while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE);
         }
 
-	}else{
+	} else {
 
 		/* Do not wait when the Primary PLL is off or display control is already off.
 			   This will prevent the software to wait forever. */
@@ -178,31 +178,31 @@ static void waitNextVerticalSync(int ctrl,int delay)
 	}
 }
 
-static void swPanelPowerSequence(int disp,int delay)
+static void swPanelPowerSequence(int disp, int delay)
 {
 	unsigned int reg;
 
 	/* disp should be 1 to open sequence */
 	reg = PEEK32(PANEL_DISPLAY_CTRL);
-	reg = FIELD_VALUE(reg,PANEL_DISPLAY_CTRL,FPEN,disp);
-	POKE32(PANEL_DISPLAY_CTRL,reg);
+	reg = FIELD_VALUE(reg, PANEL_DISPLAY_CTRL, FPEN, disp);
+	POKE32(PANEL_DISPLAY_CTRL, reg);
 	primaryWaitVerticalSync(delay);
 
 
 	reg = PEEK32(PANEL_DISPLAY_CTRL);
-	reg = FIELD_VALUE(reg,PANEL_DISPLAY_CTRL,DATA,disp);
-	POKE32(PANEL_DISPLAY_CTRL,reg);
+	reg = FIELD_VALUE(reg, PANEL_DISPLAY_CTRL, DATA, disp);
+	POKE32(PANEL_DISPLAY_CTRL, reg);
 	primaryWaitVerticalSync(delay);
 
 	reg = PEEK32(PANEL_DISPLAY_CTRL);
-	reg = FIELD_VALUE(reg,PANEL_DISPLAY_CTRL,VBIASEN,disp);
-	POKE32(PANEL_DISPLAY_CTRL,reg);
+	reg = FIELD_VALUE(reg, PANEL_DISPLAY_CTRL, VBIASEN, disp);
+	POKE32(PANEL_DISPLAY_CTRL, reg);
 	primaryWaitVerticalSync(delay);
 
 
 	reg = PEEK32(PANEL_DISPLAY_CTRL);
-	reg = FIELD_VALUE(reg,PANEL_DISPLAY_CTRL,FPEN,disp);
-	POKE32(PANEL_DISPLAY_CTRL,reg);
+	reg = FIELD_VALUE(reg, PANEL_DISPLAY_CTRL, FPEN, disp);
+	POKE32(PANEL_DISPLAY_CTRL, reg);
 	primaryWaitVerticalSync(delay);
 
 }
@@ -210,42 +210,42 @@ static void swPanelPowerSequence(int disp,int delay)
 void ddk750_setLogicalDispOut(disp_output_t output)
 {
 	unsigned int reg;
-	if(output & PNL_2_USAGE){
+	if (output & PNL_2_USAGE) {
 		/* set panel path controller select */
 		reg = PEEK32(PANEL_DISPLAY_CTRL);
-		reg = FIELD_VALUE(reg,PANEL_DISPLAY_CTRL,SELECT,(output & PNL_2_MASK)>>PNL_2_OFFSET);
-		POKE32(PANEL_DISPLAY_CTRL,reg);
+		reg = FIELD_VALUE(reg, PANEL_DISPLAY_CTRL, SELECT, (output & PNL_2_MASK)>>PNL_2_OFFSET);
+		POKE32(PANEL_DISPLAY_CTRL, reg);
 	}
 
-	if(output & CRT_2_USAGE){
+	if (output & CRT_2_USAGE) {
 		/* set crt path controller select */
 		reg = PEEK32(CRT_DISPLAY_CTRL);
-		reg = FIELD_VALUE(reg,CRT_DISPLAY_CTRL,SELECT,(output & CRT_2_MASK)>>CRT_2_OFFSET);
+		reg = FIELD_VALUE(reg, CRT_DISPLAY_CTRL, SELECT, (output & CRT_2_MASK)>>CRT_2_OFFSET);
 		/*se blank off */
-		reg = FIELD_SET(reg,CRT_DISPLAY_CTRL,BLANK,OFF);
-		POKE32(CRT_DISPLAY_CTRL,reg);
+		reg = FIELD_SET(reg, CRT_DISPLAY_CTRL, BLANK, OFF);
+		POKE32(CRT_DISPLAY_CTRL, reg);
 
 	}
 
-	if(output & PRI_TP_USAGE){
+	if (output & PRI_TP_USAGE) {
 		/* set primary timing and plane en_bit */
-		setDisplayControl(0,(output&PRI_TP_MASK)>>PRI_TP_OFFSET);
+		setDisplayControl(0, (output&PRI_TP_MASK)>>PRI_TP_OFFSET);
 	}
 
-	if(output & SEC_TP_USAGE){
+	if (output & SEC_TP_USAGE) {
 		/* set secondary timing and plane en_bit*/
-		setDisplayControl(1,(output&SEC_TP_MASK)>>SEC_TP_OFFSET);
+		setDisplayControl(1, (output&SEC_TP_MASK)>>SEC_TP_OFFSET);
 	}
 
-	if(output & PNL_SEQ_USAGE){
+	if (output & PNL_SEQ_USAGE) {
 		/* set  panel sequence */
-		swPanelPowerSequence((output&PNL_SEQ_MASK)>>PNL_SEQ_OFFSET,4);
+		swPanelPowerSequence((output&PNL_SEQ_MASK)>>PNL_SEQ_OFFSET, 4);
 	}
 
-	if(output & DAC_USAGE)
+	if (output & DAC_USAGE)
 		setDAC((output & DAC_MASK)>>DAC_OFFSET);
 
-	if(output & DPMS_USAGE)
+	if (output & DPMS_USAGE)
 		ddk750_setDPMS((output & DPMS_MASK) >> DPMS_OFFSET);
 }
 
diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c
index 8a37ce9..d42dd66 100644
--- a/drivers/staging/sm750fb/ddk750_dvi.c
+++ b/drivers/staging/sm750fb/ddk750_dvi.c
@@ -1,4 +1,4 @@
-#define USE_DVICHIP 
+#define USE_DVICHIP
 #ifdef USE_DVICHIP
 #include "ddk750_help.h"
 #include "ddk750_reg.h"
diff --git a/drivers/staging/sm750fb/ddk750_help.c b/drivers/staging/sm750fb/ddk750_help.c
index c68ff3b..3fa7236 100644
--- a/drivers/staging/sm750fb/ddk750_help.c
+++ b/drivers/staging/sm750fb/ddk750_help.c
@@ -2,17 +2,17 @@
 //#include "ddk750_chip.h"
 #include "ddk750_help.h"
 
-void __iomem * mmio750 = NULL;
+void __iomem *mmio750 = NULL;
 char revId750 = 0;
 unsigned short devId750 = 0;
 
 /* after driver mapped io registers, use this function first */
-void ddk750_set_mmio(void __iomem * addr,unsigned short devId,char revId)
+void ddk750_set_mmio(void __iomem *addr, unsigned short devId, char revId)
 {
 	mmio750 = addr;
 	devId750 = devId;
 	revId750 = revId;
-	if(revId == 0xfe)
+	if (revId == 0xfe)
 		printk("found sm750le\n");
 }
 
diff --git a/drivers/staging/sm750fb/ddk750_power.c b/drivers/staging/sm750fb/ddk750_power.c
index fcc1317..a7fd5db 100644
--- a/drivers/staging/sm750fb/ddk750_power.c
+++ b/drivers/staging/sm750fb/ddk750_power.c
@@ -5,19 +5,19 @@
 void ddk750_setDPMS(DPMS_t state)
 {
 	unsigned int value;
-	if(getChipType() == SM750LE){
+	if (getChipType() == SM750LE) {
 		value = PEEK32(CRT_DISPLAY_CTRL);
-		POKE32(CRT_DISPLAY_CTRL,FIELD_VALUE(value,CRT_DISPLAY_CTRL,DPMS,state));
-	}else{
+		POKE32(CRT_DISPLAY_CTRL, FIELD_VALUE(value, CRT_DISPLAY_CTRL, DPMS, state));
+	} else {
 		value = PEEK32(SYSTEM_CTRL);
-		value= FIELD_VALUE(value,SYSTEM_CTRL,DPMS,state);
+		value = FIELD_VALUE(value, SYSTEM_CTRL, DPMS, state);
 		POKE32(SYSTEM_CTRL, value);
 	}
 }
 
 unsigned int getPowerMode(void)
 {
-	if(getChipType() == SM750LE)
+	if (getChipType() == SM750LE)
 		return 0;
     return (FIELD_GET(PEEK32(POWER_MODE_CTRL), POWER_MODE_CTRL, MODE));
 }
@@ -29,43 +29,40 @@ unsigned int getPowerMode(void)
  */
 void setPowerMode(unsigned int powerMode)
 {
-    unsigned int control_value = 0;
+	unsigned int control_value = 0;
 
-    control_value = PEEK32(POWER_MODE_CTRL);
+	control_value = PEEK32(POWER_MODE_CTRL);
 
-	if(getChipType() == SM750LE)
+	if (getChipType() == SM750LE)
 		return;
 
 	switch (powerMode) {
-        case POWER_MODE_CTRL_MODE_MODE0:
-            control_value = FIELD_SET(control_value, POWER_MODE_CTRL, MODE, MODE0);
-            break;
-
-        case POWER_MODE_CTRL_MODE_MODE1:
-            control_value = FIELD_SET(control_value, POWER_MODE_CTRL, MODE, MODE1);
-            break;
-
-        case POWER_MODE_CTRL_MODE_SLEEP:
-            control_value = FIELD_SET(control_value, POWER_MODE_CTRL, MODE, SLEEP);
-            break;
-
-        default:
-            break;
-    }
+	case POWER_MODE_CTRL_MODE_MODE0:
+		control_value = FIELD_SET(control_value, POWER_MODE_CTRL, MODE, MODE0);
+		break;
+	case POWER_MODE_CTRL_MODE_MODE1:
+		control_value = FIELD_SET(control_value, POWER_MODE_CTRL, MODE, MODE1);
+		break;
+	case POWER_MODE_CTRL_MODE_SLEEP:
+		control_value = FIELD_SET(control_value, POWER_MODE_CTRL, MODE, SLEEP);
+		break;
+	default:
+		break;
+	}
 
     /* Set up other fields in Power Control Register */
     if (powerMode == POWER_MODE_CTRL_MODE_SLEEP) {
         control_value =
 #ifdef VALIDATION_CHIP
-            FIELD_SET(  control_value, POWER_MODE_CTRL, 336CLK, OFF) |
+		FIELD_SET(control_value, POWER_MODE_CTRL, 336CLK, OFF) |
 #endif
-            FIELD_SET(  control_value, POWER_MODE_CTRL, OSC_INPUT,  OFF);
+		FIELD_SET(control_value, POWER_MODE_CTRL, OSC_INPUT,  OFF);
     } else {
         control_value =
 #ifdef VALIDATION_CHIP
-            FIELD_SET(  control_value, POWER_MODE_CTRL, 336CLK, ON) |
+		FIELD_SET(control_value, POWER_MODE_CTRL, 336CLK, ON) |
 #endif
-            FIELD_SET(  control_value, POWER_MODE_CTRL, OSC_INPUT,  ON);
+		FIELD_SET(control_value, POWER_MODE_CTRL, OSC_INPUT,  ON);
     }
 
     /* Program new power mode. */
diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c
index b20e1f8..c7d1cb9 100644
--- a/drivers/staging/sm750fb/sm750_cursor.c
+++ b/drivers/staging/sm750fb/sm750_cursor.c
@@ -23,8 +23,8 @@
 #define PEEK32(addr) \
 readl(cursor->mmio + (addr))
 
-#define POKE32(addr,data) \
-writel((data),cursor->mmio + (addr))
+#define POKE32(addr, data) \
+writel((data), cursor->mmio + (addr))
 
 /* cursor control for voyager and 718/750*/
 #define HWC_ADDRESS                         0x0
@@ -58,45 +58,45 @@ writel((data),cursor->mmio + (addr))
 
 
 /* hw_cursor_xxx works for voyager,718 and 750 */
-void hw_cursor_enable(struct lynx_cursor * cursor)
+void hw_cursor_enable(struct lynx_cursor *cursor)
 {
 	u32 reg;
-	reg = FIELD_VALUE(0,HWC_ADDRESS,ADDRESS,cursor->offset)|
-			FIELD_SET(0,HWC_ADDRESS,EXT,LOCAL)|
-			FIELD_SET(0,HWC_ADDRESS,ENABLE,ENABLE);
-	POKE32(HWC_ADDRESS,reg);
+	reg = FIELD_VALUE(0, HWC_ADDRESS, ADDRESS, cursor->offset)|
+			FIELD_SET(0, HWC_ADDRESS, EXT, LOCAL)|
+			FIELD_SET(0, HWC_ADDRESS, ENABLE, ENABLE);
+	POKE32(HWC_ADDRESS, reg);
 }
-void hw_cursor_disable(struct lynx_cursor * cursor)
+void hw_cursor_disable(struct lynx_cursor *cursor)
 {
-	POKE32(HWC_ADDRESS,0);
+	POKE32(HWC_ADDRESS, 0);
 }
 
-void hw_cursor_setSize(struct lynx_cursor * cursor,
-						int w,int h)
+void hw_cursor_setSize(struct lynx_cursor *cursor,
+						int w, int h)
 {
 	cursor->w = w;
 	cursor->h = h;
 }
-void hw_cursor_setPos(struct lynx_cursor * cursor,
-						int x,int y)
+void hw_cursor_setPos(struct lynx_cursor *cursor,
+						int x, int y)
 {
 	u32 reg;
-	reg = FIELD_VALUE(0,HWC_LOCATION,Y,y)|
-			FIELD_VALUE(0,HWC_LOCATION,X,x);
-	POKE32(HWC_LOCATION,reg);
+	reg = FIELD_VALUE(0, HWC_LOCATION, Y, y)|
+			FIELD_VALUE(0, HWC_LOCATION, X, x);
+	POKE32(HWC_LOCATION, reg);
 }
-void hw_cursor_setColor(struct lynx_cursor * cursor,
-						u32 fg,u32 bg)
+void hw_cursor_setColor(struct lynx_cursor *cursor,
+						u32 fg, u32 bg)
 {
-	POKE32(HWC_COLOR_12,(fg<<16)|(bg&0xffff));
-	POKE32(HWC_COLOR_3,0xffe0);
+	POKE32(HWC_COLOR_12, (fg<<16)|(bg&0xffff));
+	POKE32(HWC_COLOR_3, 0xffe0);
 }
 
-void hw_cursor_setData(struct lynx_cursor * cursor,
-			u16 rop,const u8* pcol,const u8* pmsk)
+void hw_cursor_setData(struct lynx_cursor *cursor,
+			u16 rop, const u8 *pcol, const u8 *pmsk)
 {
-	int i,j,count,pitch,offset;
-	u8 color,mask,opr;
+	int i, j, count, pitch, offset;
+	u8 color, mask, opr;
 	u16 data;
 	void __iomem *pbuffer, *pstart;
 
@@ -131,7 +131,7 @@ void hw_cursor_setData(struct lynx_cursor * cursor,
 		 * but method 2 shows no lag
 		 * and method 1 seems a bit wrong*/
 #if 0
-		if(rop == ROP_XOR)
+		if (rop == ROP_XOR)
 			opr = mask ^ color;
 		else
 			opr = mask & color;
@@ -140,15 +140,15 @@ void hw_cursor_setData(struct lynx_cursor * cursor,
 
 			if (opr & (0x80 >> j)) {
 				data |= 2 << (j*2);
-			}else{
+			} else {
 				//use bg color,id = 1
 				data |= 1 << (j*2);
 			}
 		}
 #else
 		for (j = 0; j < 8; j++) {
-			if(mask & (0x80>>j)){
-				if(rop == ROP_XOR)
+			if (mask & (0x80>>j)) {
+				if (rop == ROP_XOR)
 					opr = mask ^ color;
 				else
 					opr = mask & color;
@@ -165,7 +165,7 @@ void hw_cursor_setData(struct lynx_cursor * cursor,
 			/* need a return */
 			pstart += offset;
 			pbuffer = pstart;
-		}else{
+		} else {
 			pbuffer += sizeof(u16);
 		}
 
@@ -175,10 +175,10 @@ void hw_cursor_setData(struct lynx_cursor * cursor,
 }
 
 
-void hw_cursor_setData2(struct lynx_cursor * cursor,
-			u16 rop,const u8* pcol,const u8* pmsk)
+void hw_cursor_setData2(struct lynx_cursor *cursor,
+			u16 rop, const u8 *pcol, const u8 *pmsk)
 {
-	int i,j,count,pitch,offset;
+	int i, j, count, pitch, offset;
 	u8 color, mask;
 	u16 data;
 	void __iomem *pbuffer, *pstart;
@@ -203,7 +203,7 @@ void hw_cursor_setData2(struct lynx_cursor * cursor,
 
 		/* either method below works well, but method 2 shows no lag */
 #if 0
-		if(rop == ROP_XOR)
+		if (rop == ROP_XOR)
 			opr = mask ^ color;
 		else
 			opr = mask & color;
@@ -213,14 +213,14 @@ void hw_cursor_setData2(struct lynx_cursor * cursor,
 			if (opr & (0x80 >> j)) {
 				/* use fg color,id = 2 */
 				data |= 2 << (j*2);
-			}else{
 				//use bg color,id = 1
+			} else {
 				data |= 1 << (j*2);
 			}
 		}
 #else
-		for(j=0;j<8;j++){
-			if(mask & (1<<j))
+		for (j = 0; j < 8; j++) {
+			if (mask & (1<<j))
 				data |= ((color & (1<<j))?1:2)<<(j*2);
 		}
 #endif
@@ -231,7 +231,7 @@ void hw_cursor_setData2(struct lynx_cursor * cursor,
 			/* need a return */
 			pstart += offset;
 			pbuffer = pstart;
-		}else{
+		} else {
 			pbuffer += sizeof(u16);
 		}
 
-- 
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