[PATCH 04/16] Fix code style for time functions

Simon Glass sjg at chromium.org
Mon Aug 3 00:59:28 CEST 2020


Fix the code style used for some time functions.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/arm/cpu/arm920t/imx/timer.c |  2 +-
 arch/arm/cpu/sa1100/timer.c      |  2 +-
 arch/microblaze/cpu/timer.c      |  2 +-
 arch/powerpc/lib/interrupts.c    |  2 +-
 arch/powerpc/lib/time.c          |  5 +++--
 board/armltd/integrator/timer.c  |  2 +-
 drivers/fpga/ACEX1K.c            |  4 ++--
 drivers/fpga/spartan2.c          | 24 ++++++++++++------------
 drivers/fpga/spartan3.c          | 24 ++++++++++++------------
 drivers/net/lan91c96.c           |  4 ++--
 drivers/net/ne2000_base.c        |  4 ++--
 drivers/net/smc91111.c           |  4 ++--
 post/drivers/rtc.c               |  4 ++--
 13 files changed, 42 insertions(+), 41 deletions(-)

diff --git a/arch/arm/cpu/arm920t/imx/timer.c b/arch/arm/cpu/arm920t/imx/timer.c
index e9d55779214..b559db75f12 100644
--- a/arch/arm/cpu/arm920t/imx/timer.c
+++ b/arch/arm/cpu/arm920t/imx/timer.c
@@ -44,7 +44,7 @@ static ulong get_timer_masked (void)
 	return TCN1;
 }
 
-ulong get_timer (ulong base)
+ulong get_timer(ulong base)
 {
 	return get_timer_masked() - base;
 }
diff --git a/arch/arm/cpu/sa1100/timer.c b/arch/arm/cpu/sa1100/timer.c
index a5cdaf5a66c..5d597dd1ab4 100644
--- a/arch/arm/cpu/sa1100/timer.c
+++ b/arch/arm/cpu/sa1100/timer.c
@@ -19,7 +19,7 @@ static ulong get_timer_masked (void)
 	return OSCR;
 }
 
-ulong get_timer (ulong base)
+ulong get_timer(ulong base)
 {
 	return get_timer_masked ();
 }
diff --git a/arch/microblaze/cpu/timer.c b/arch/microblaze/cpu/timer.c
index 647bdcd5ba5..05ab0e1b157 100644
--- a/arch/microblaze/cpu/timer.c
+++ b/arch/microblaze/cpu/timer.c
@@ -20,7 +20,7 @@ DECLARE_GLOBAL_DATA_PTR;
 volatile int timestamp = 0;
 microblaze_timer_t *tmr;
 
-ulong get_timer (ulong base)
+ulong get_timer(ulong base)
 {
 	if (tmr)
 		return timestamp - base;
diff --git a/arch/powerpc/lib/interrupts.c b/arch/powerpc/lib/interrupts.c
index 73f270002cf..bda0999327d 100644
--- a/arch/powerpc/lib/interrupts.c
+++ b/arch/powerpc/lib/interrupts.c
@@ -89,7 +89,7 @@ void timer_interrupt(struct pt_regs *regs)
 #endif /* CONFIG_LED_STATUS */
 }
 
-ulong get_timer (ulong base)
+ulong get_timer(ulong base)
 {
 	return (timestamp - base);
 }
diff --git a/arch/powerpc/lib/time.c b/arch/powerpc/lib/time.c
index 8d6babfb83d..d27432c23af 100644
--- a/arch/powerpc/lib/time.c
+++ b/arch/powerpc/lib/time.c
@@ -39,8 +39,9 @@ unsigned long usec2ticks(unsigned long usec)
  */
 void __udelay(unsigned long usec)
 {
-	ulong ticks = usec2ticks (usec);
-	wait_ticks (ticks);
+	ulong ticks = usec2ticks(usec);
+
+	wait_ticks(ticks);
 }
 
 /* ------------------------------------------------------------------------- */
diff --git a/board/armltd/integrator/timer.c b/board/armltd/integrator/timer.c
index d220b877d66..53d1c0ec303 100644
--- a/board/armltd/integrator/timer.c
+++ b/board/armltd/integrator/timer.c
@@ -119,7 +119,7 @@ static ulong get_timer_masked (void)
 	return timestamp;
 }
 
-ulong get_timer (ulong base_ticks)
+ulong get_timer(ulong base_ticks)
 {
 	return get_timer_masked () - base_ticks;
 }
diff --git a/drivers/fpga/ACEX1K.c b/drivers/fpga/ACEX1K.c
index aca8049c56a..30a3727433e 100644
--- a/drivers/fpga/ACEX1K.c
+++ b/drivers/fpga/ACEX1K.c
@@ -140,10 +140,10 @@ static int ACEX1K_ps_load(Altera_desc *desc, const void *buf, size_t bsize)
 		udelay(2);		/* T_cf2st1 < 4us	*/
 
 		/* Wait for nSTATUS to be released (i.e. deasserted) */
-		ts = get_timer (0);		/* get current time */
+		ts = get_timer(0);		/* get current time */
 		do {
 			CONFIG_FPGA_DELAY ();
-			if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
+			if (get_timer(ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
 				puts ("** Timeout waiting for STATUS to go high.\n");
 				(*fn->abort) (cookie);
 				return FPGA_FAIL;
diff --git a/drivers/fpga/spartan2.c b/drivers/fpga/spartan2.c
index 3435400e58b..fae94f9663a 100644
--- a/drivers/fpga/spartan2.c
+++ b/drivers/fpga/spartan2.c
@@ -151,11 +151,11 @@ static int spartan2_sp_load(xilinx_desc *desc, const void *buf, size_t bsize)
 		CONFIG_FPGA_DELAY ();
 		(*fn->pgm) (false, true, cookie);	/* Deassert the program, commit */
 
-		ts = get_timer (0);		/* get current time */
+		ts = get_timer(0);		/* get current time */
 		/* Now wait for INIT and BUSY to go high */
 		do {
 			CONFIG_FPGA_DELAY ();
-			if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
+			if (get_timer(ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
 				puts ("** Timeout waiting for INIT to clear.\n");
 				(*fn->abort) (cookie);	/* abort the burn */
 				return FPGA_FAIL;
@@ -178,7 +178,7 @@ static int spartan2_sp_load(xilinx_desc *desc, const void *buf, size_t bsize)
 			(*fn->clk) (true, true, cookie);	/* Assert the clock pin */
 
 #ifdef CONFIG_SYS_FPGA_CHECK_BUSY
-			ts = get_timer (0);	/* get current time */
+			ts = get_timer(0);	/* get current time */
 			while ((*fn->busy) (cookie)) {
 				/* XXX - we should have a check in here somewhere to
 				 * make sure we aren't busy forever... */
@@ -188,7 +188,7 @@ static int spartan2_sp_load(xilinx_desc *desc, const void *buf, size_t bsize)
 				CONFIG_FPGA_DELAY ();
 				(*fn->clk) (true, true, cookie);	/* Assert the clock pin */
 
-				if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
+				if (get_timer(ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
 					puts ("** Timeout waiting for BUSY to clear.\n");
 					(*fn->abort) (cookie);	/* abort the burn */
 					return FPGA_FAIL;
@@ -211,7 +211,7 @@ static int spartan2_sp_load(xilinx_desc *desc, const void *buf, size_t bsize)
 #endif
 
 		/* now check for done signal */
-		ts = get_timer (0);		/* get current time */
+		ts = get_timer(0);		/* get current time */
 		ret_val = FPGA_SUCCESS;
 		while ((*fn->done) (cookie) == FPGA_FAIL) {
 
@@ -220,7 +220,7 @@ static int spartan2_sp_load(xilinx_desc *desc, const void *buf, size_t bsize)
 			CONFIG_FPGA_DELAY ();
 			(*fn->clk) (true, true, cookie);	/* Assert the clock pin */
 
-			if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
+			if (get_timer(ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
 				puts ("** Timeout waiting for DONE to clear.\n");
 				(*fn->abort) (cookie);	/* abort the burn */
 				ret_val = FPGA_FAIL;
@@ -337,10 +337,10 @@ static int spartan2_ss_load(xilinx_desc *desc, const void *buf, size_t bsize)
 		(*fn->pgm) (true, true, cookie);	/* Assert the program, commit */
 
 		/* Wait for INIT state (init low)                            */
-		ts = get_timer (0);		/* get current time */
+		ts = get_timer(0);		/* get current time */
 		do {
 			CONFIG_FPGA_DELAY ();
-			if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
+			if (get_timer(ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
 				puts ("** Timeout waiting for INIT to start.\n");
 				return FPGA_FAIL;
 			}
@@ -350,11 +350,11 @@ static int spartan2_ss_load(xilinx_desc *desc, const void *buf, size_t bsize)
 		CONFIG_FPGA_DELAY ();
 		(*fn->pgm) (false, true, cookie);	/* Deassert the program, commit */
 
-		ts = get_timer (0);		/* get current time */
+		ts = get_timer(0);		/* get current time */
 		/* Now wait for INIT to go high */
 		do {
 			CONFIG_FPGA_DELAY ();
-			if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
+			if (get_timer(ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
 				puts ("** Timeout waiting for INIT to clear.\n");
 				return FPGA_FAIL;
 			}
@@ -398,7 +398,7 @@ static int spartan2_ss_load(xilinx_desc *desc, const void *buf, size_t bsize)
 #endif
 
 		/* now check for done signal */
-		ts = get_timer (0);		/* get current time */
+		ts = get_timer(0);		/* get current time */
 		ret_val = FPGA_SUCCESS;
 		(*fn->wr) (true, true, cookie);
 
@@ -411,7 +411,7 @@ static int spartan2_ss_load(xilinx_desc *desc, const void *buf, size_t bsize)
 
 			putc ('*');
 
-			if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
+			if (get_timer(ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
 				puts ("** Timeout waiting for DONE to clear.\n");
 				ret_val = FPGA_FAIL;
 				break;
diff --git a/drivers/fpga/spartan3.c b/drivers/fpga/spartan3.c
index 4850c99352d..e40e427a25f 100644
--- a/drivers/fpga/spartan3.c
+++ b/drivers/fpga/spartan3.c
@@ -155,11 +155,11 @@ static int spartan3_sp_load(xilinx_desc *desc, const void *buf, size_t bsize)
 		CONFIG_FPGA_DELAY ();
 		(*fn->pgm) (false, true, cookie);	/* Deassert the program, commit */
 
-		ts = get_timer (0);		/* get current time */
+		ts = get_timer(0);		/* get current time */
 		/* Now wait for INIT and BUSY to go high */
 		do {
 			CONFIG_FPGA_DELAY ();
-			if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
+			if (get_timer(ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
 				puts ("** Timeout waiting for INIT to clear.\n");
 				(*fn->abort) (cookie);	/* abort the burn */
 				return FPGA_FAIL;
@@ -182,7 +182,7 @@ static int spartan3_sp_load(xilinx_desc *desc, const void *buf, size_t bsize)
 			(*fn->clk) (true, true, cookie);	/* Assert the clock pin */
 
 #ifdef CONFIG_SYS_FPGA_CHECK_BUSY
-			ts = get_timer (0);	/* get current time */
+			ts = get_timer(0);	/* get current time */
 			while ((*fn->busy) (cookie)) {
 				/* XXX - we should have a check in here somewhere to
 				 * make sure we aren't busy forever... */
@@ -192,7 +192,7 @@ static int spartan3_sp_load(xilinx_desc *desc, const void *buf, size_t bsize)
 				CONFIG_FPGA_DELAY ();
 				(*fn->clk) (true, true, cookie);	/* Assert the clock pin */
 
-				if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
+				if (get_timer(ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
 					puts ("** Timeout waiting for BUSY to clear.\n");
 					(*fn->abort) (cookie);	/* abort the burn */
 					return FPGA_FAIL;
@@ -215,7 +215,7 @@ static int spartan3_sp_load(xilinx_desc *desc, const void *buf, size_t bsize)
 #endif
 
 		/* now check for done signal */
-		ts = get_timer (0);		/* get current time */
+		ts = get_timer(0);		/* get current time */
 		ret_val = FPGA_SUCCESS;
 		while ((*fn->done) (cookie) == FPGA_FAIL) {
 			/* XXX - we should have a check in here somewhere to
@@ -226,7 +226,7 @@ static int spartan3_sp_load(xilinx_desc *desc, const void *buf, size_t bsize)
 			CONFIG_FPGA_DELAY ();
 			(*fn->clk) (true, true, cookie);	/* Assert the clock pin */
 
-			if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
+			if (get_timer(ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
 				puts ("** Timeout waiting for DONE to clear.\n");
 				(*fn->abort) (cookie);	/* abort the burn */
 				ret_val = FPGA_FAIL;
@@ -343,10 +343,10 @@ static int spartan3_ss_load(xilinx_desc *desc, const void *buf, size_t bsize)
 		(*fn->pgm) (true, true, cookie);	/* Assert the program, commit */
 
 		/* Wait for INIT state (init low)                            */
-		ts = get_timer (0);		/* get current time */
+		ts = get_timer(0);		/* get current time */
 		do {
 			CONFIG_FPGA_DELAY ();
-			if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
+			if (get_timer(ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
 				puts ("** Timeout waiting for INIT to start.\n");
 				if (*fn->abort)
 					(*fn->abort) (cookie);
@@ -358,11 +358,11 @@ static int spartan3_ss_load(xilinx_desc *desc, const void *buf, size_t bsize)
 		CONFIG_FPGA_DELAY ();
 		(*fn->pgm) (false, true, cookie);	/* Deassert the program, commit */
 
-		ts = get_timer (0);		/* get current time */
+		ts = get_timer(0);		/* get current time */
 		/* Now wait for INIT to go high */
 		do {
 			CONFIG_FPGA_DELAY ();
-			if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
+			if (get_timer(ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
 				puts ("** Timeout waiting for INIT to clear.\n");
 				if (*fn->abort)
 					(*fn->abort) (cookie);
@@ -414,7 +414,7 @@ static int spartan3_ss_load(xilinx_desc *desc, const void *buf, size_t bsize)
 #endif
 
 		/* now check for done signal */
-		ts = get_timer (0);		/* get current time */
+		ts = get_timer(0);		/* get current time */
 		ret_val = FPGA_SUCCESS;
 		(*fn->wr) (true, true, cookie);
 
@@ -429,7 +429,7 @@ static int spartan3_ss_load(xilinx_desc *desc, const void *buf, size_t bsize)
 
 			putc ('*');
 
-			if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
+			if (get_timer(ts) > CONFIG_SYS_FPGA_WAIT) {	/* check the time */
 				puts ("** Timeout waiting for DONE to clear.\n");
 				ret_val = FPGA_FAIL;
 				break;
diff --git a/drivers/net/lan91c96.c b/drivers/net/lan91c96.c
index c2f611144db..470c68467cd 100644
--- a/drivers/net/lan91c96.c
+++ b/drivers/net/lan91c96.c
@@ -164,14 +164,14 @@ static void print_packet (byte *, int);
 
 static int poll4int (struct eth_device *dev, byte mask, int timeout)
 {
-	int tmo = get_timer (0) + timeout * CONFIG_SYS_HZ;
+	int tmo = get_timer(0) + timeout * CONFIG_SYS_HZ;
 	int is_timeout = 0;
 	word old_bank = SMC_inw(dev, LAN91C96_BANK_SELECT);
 
 	PRINTK2 ("Polling...\n");
 	SMC_SELECT_BANK(dev, 2);
 	while ((SMC_inw(dev, LAN91C96_INT_STATS) & mask) == 0) {
-		if (get_timer (0) >= tmo) {
+		if (get_timer(0) >= tmo) {
 			is_timeout = 1;
 			break;
 		}
diff --git a/drivers/net/ne2000_base.c b/drivers/net/ne2000_base.c
index f6673f5e4c6..09cc8398003 100644
--- a/drivers/net/ne2000_base.c
+++ b/drivers/net/ne2000_base.c
@@ -750,14 +750,14 @@ static int ne2k_send(struct eth_device *dev, void *packet, int length)
 	pkey = -1;
 
 	dp83902a_send((u8 *) packet, length, 666);
-	tmo = get_timer (0) + TOUT * CONFIG_SYS_HZ;
+	tmo = get_timer(0) + TOUT * CONFIG_SYS_HZ;
 	while(1) {
 		dp83902a_poll();
 		if (pkey != -1) {
 			PRINTK("Packet sucesfully sent\n");
 			return 0;
 		}
-		if (get_timer (0) >= tmo) {
+		if (get_timer(0) >= tmo) {
 			printf("transmission error (timoeut)\n");
 			return 0;
 		}
diff --git a/drivers/net/smc91111.c b/drivers/net/smc91111.c
index ec4e8e928cb..fea6ba8caaa 100644
--- a/drivers/net/smc91111.c
+++ b/drivers/net/smc91111.c
@@ -238,14 +238,14 @@ static void print_packet( byte *, int );
 
 static int poll4int (struct eth_device *dev, byte mask, int timeout)
 {
-	int tmo = get_timer (0) + timeout * CONFIG_SYS_HZ;
+	int tmo = get_timer(0) + timeout * CONFIG_SYS_HZ;
 	int is_timeout = 0;
 	word old_bank = SMC_inw (dev, BSR_REG);
 
 	PRINTK2 ("Polling...\n");
 	SMC_SELECT_BANK (dev, 2);
 	while ((SMC_inw (dev, SMC91111_INT_REG) & mask) == 0) {
-		if (get_timer (0) >= tmo) {
+		if (get_timer(0) >= tmo) {
 			is_timeout = 1;
 			break;
 		}
diff --git a/post/drivers/rtc.c b/post/drivers/rtc.c
index c603f0e6728..af701e464d3 100644
--- a/post/drivers/rtc.c
+++ b/post/drivers/rtc.c
@@ -36,11 +36,11 @@ static int rtc_post_skip (ulong * diff)
 	ulong start2;
 
 	rtc_get (&tm1);
-	start1 = get_timer (0);
+	start1 = get_timer(0);
 
 	while (1) {
 		rtc_get (&tm2);
-		start2 = get_timer (0);
+		start2 = get_timer(0);
 		if (tm1.tm_sec != tm2.tm_sec)
 			break;
 		if (start2 - start1 > 1500)
-- 
2.28.0.163.g6104cc2f0b6-goog



More information about the U-Boot mailing list