diff --git a/board/prodrive/alpr/fpga.c b/board/prodrive/alpr/fpga.c
index 3666a9a..e7686ad 100644
--- a/board/prodrive/alpr/fpga.c
+++ b/board/prodrive/alpr/fpga.c
@@ -39,24 +39,24 @@
 #if defined(CONFIG_FPGA)
 
 #ifdef FPGA_DEBUG
-#define	PRINTF(fmt,args...)	printf (fmt ,##args)
+#define	PRINTF(fmt, args...)	printf(fmt , ##args)
 #else
-#define	PRINTF(fmt,args...)
+#define	PRINTF(fmt, args...)
 #endif
 
 static unsigned long regval;
 
-#define SET_GPIO_REG_0(reg, bit) {				\
+#define SET_GPIO_REG_0(reg, bit) do {				\
 		regval = in32(reg);				\
 		regval &= ~(0x80000000 >> bit);			\
 		out32(reg, regval);				\
-	}
+	} while (0)
 
-#define SET_GPIO_REG_1(reg, bit) {				\
+#define SET_GPIO_REG_1(reg, bit) do {				\
 		regval = in32(reg);				\
 		regval |= (0x80000000 >> bit);			\
 		out32(reg, regval);				\
-	}
+	} while (0)
 
 #define	SET_GPIO_0(bit)		SET_GPIO_REG_0(GPIO0_OR, bit)
 #define	SET_GPIO_1(bit)		SET_GPIO_REG_1(GPIO0_OR, bit)
@@ -69,19 +69,21 @@
 
 #define SET_FPGA(data)		out32(GPIO0_OR, data)
 
-#define FPGA_WRITE_1 {							\
-		SET_FPGA(OLD_VAL | 0        | FPGA_DATA);  /* set data to 1  */	\
-		SET_FPGA(OLD_VAL | FPGA_CLK | FPGA_DATA);} /* set data to 1  */
+#define FPGA_WRITE_1 do {							    \
+	SET_FPGA(OLD_VAL | 0	    | FPGA_DATA);	/* set data to 1 */ \
+	SET_FPGA(OLD_VAL | FPGA_CLK | FPGA_DATA);	/* set data to 1 */ \
+} while (0)
 
-#define FPGA_WRITE_0 {							\
-		SET_FPGA(OLD_VAL | 0        | 0        );   /* set data to 0  */ \
-		SET_FPGA(OLD_VAL | FPGA_CLK | 0        );}  /* set data to 1  */
+#define FPGA_WRITE_0 do {							    \
+	SET_FPGA(OLD_VAL | 0	    | 0);		/* set data to 0 */ \
+	SET_FPGA(OLD_VAL | FPGA_CLK | 0);		/* set data to 1 */ \
+} while (0)
 
 /* Plattforminitializations */
 /* Here we have to set the FPGA Chain */
 /* PROGRAM_PROG_EN	= HIGH */
 /* PROGRAM_SEL_DPR	= LOW */
-int fpga_pre_fn (int cookie)
+int fpga_pre_fn(int cookie)
 {
 	unsigned long	reg;
 
@@ -128,23 +130,23 @@
 }
 
 /* Set the state of CONFIG Pin */
-int fpga_config_fn (int assert_config, int flush, int cookie)
+int fpga_config_fn(int assert_config, int flush, int cookie)
 {
-	if (assert_config) {
+	if (assert_config)
 		SET_GPIO_1(CONFIG_SYS_GPIO_CONFIG);
-	} else {
+	else
 		SET_GPIO_0(CONFIG_SYS_GPIO_CONFIG);
-	}
+
 	return FPGA_SUCCESS;
 }
 
 /* Returns the state of STATUS Pin */
-int fpga_status_fn (int cookie)
+int fpga_status_fn(int cookie)
 {
 	unsigned long	reg;
 
 	reg = in32(GPIO0_IR);
-	if (reg &= (0x80000000 >> CONFIG_SYS_GPIO_STATUS)) {
+	if (reg & (0x80000000 >> CONFIG_SYS_GPIO_STATUS)) {
 		PRINTF("STATUS = HIGH\n");
 		return FPGA_FAIL;
 	}
@@ -153,11 +155,11 @@
 }
 
 /* Returns the state of CONF_DONE Pin */
-int fpga_done_fn (int cookie)
+int fpga_done_fn(int cookie)
 {
 	unsigned long	reg;
 	reg = in32(GPIO0_IR);
-	if (reg &= (0x80000000 >> CONFIG_SYS_GPIO_CON_DON)) {
+	if (reg & (0x80000000 >> CONFIG_SYS_GPIO_CON_DON)) {
 		PRINTF("CONF_DON = HIGH\n");
 		return FPGA_FAIL;
 	}
@@ -168,11 +170,11 @@
 /* writes the complete buffer to the FPGA
    writing the complete buffer in one function is much faster,
    then calling it for every bit */
-int fpga_write_fn (const void *buf, size_t len, int flush, int cookie)
+int fpga_write_fn(const void *buf, size_t len, int flush, int cookie)
 {
 	size_t bytecount = 0;
 	unsigned char *data = (unsigned char *) buf;
-	unsigned char val=0;
+	unsigned char val = 0;
 	int		i;
 	int len_40 = len / 40;
 
@@ -180,20 +182,20 @@
 		val = data[bytecount++];
 		i = 8;
 		do {
-			if (val & 0x01) {
+			if (val & 0x01)
 				FPGA_WRITE_1;
-			} else {
+			else
 				FPGA_WRITE_0;
-			}
+
 			val >>= 1;
-			i --;
+			i--;
 		} while (i > 0);
 
 #ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
 		if (bytecount % len_40 == 0) {
-			putc ('.');		/* let them know we are alive */
+			putc('.');		/* let them know we are alive */
 #ifdef CONFIG_SYS_FPGA_CHECK_CTRLC
-			if (ctrlc ())
+			if (ctrlc())
 				return FPGA_FAIL;
 #endif
 		}
@@ -203,16 +205,16 @@
 }
 
 /* called, when programming is aborted */
-int fpga_abort_fn (int cookie)
+int fpga_abort_fn(int cookie)
 {
 	SET_GPIO_1((CONFIG_SYS_GPIO_SEL_DPR));
 	return FPGA_SUCCESS;
 }
 
 /* called, when programming was succesful */
-int fpga_post_fn (int cookie)
+int fpga_post_fn(int cookie)
 {
-	return fpga_abort_fn (cookie);
+	return fpga_abort_fn(cookie);
 }
 
 /* Note that these are pointers to code that is in Flash.  They will be
@@ -240,16 +242,16 @@
 /*
  * Initialize the fpga.  Return 1 on success, 0 on failure.
  */
-int alpr_fpga_init (void)
+int alpr_fpga_init(void)
 {
 	int i;
 
-	PRINTF ("%s:%d: Initialize FPGA interface\n", __FUNCTION__, __LINE__);
-	fpga_init ();
+	PRINTF("%s:%d: Initialize FPGA interface\n", __func__, __LINE__);
+	fpga_init();
 
 	for (i = 0; i < CONFIG_FPGA_COUNT; i++) {
-		PRINTF ("%s:%d: Adding fpga %d\n", __FUNCTION__, __LINE__, i);
-		fpga_add (fpga_altera, &fpga[i]);
+		PRINTF("%s:%d: Adding fpga %d\n", __func__, __LINE__, i);
+		fpga_add(fpga_altera, &fpga[i]);
 	}
 	return 1;
 }
