public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH-OMAP3] OMAP3: Use I2C file coding style
@ 2008-11-04 16:32 dirk.behme at googlemail.com
  2008-11-08 19:09 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 4+ messages in thread
From: dirk.behme at googlemail.com @ 2008-11-04 16:32 UTC (permalink / raw)
  To: u-boot

Subject: [PATCH-OMAP3] OMAP3: Use I2C file coding style

From: Dirk Behme <dirk.behme@gmail.com>

Use file coding style for inx/outx instead of global coding style.

Signed-off-by: Dirk Behme <dirk.behme@gmail.com>

---

Note: There was an additional review comment about this file:

-- cut --
> +#define inb(a) __raw_readb(a)
> +#define outb(a, v) __raw_writeb(a, v)
>  #define inw(a) __raw_readw(a)
>  #define outw(a,v) __raw_writew(a,v)

This 4 macro is supposed to be defined in io.h
-- cut --

In ARM's io.h there are already inx/outx macros, but with different syntax. The correct fix for omap24xx_i2c.c will be to replace all inx/outx by readx/writex macros and remove above defines. But this can't be done on OMAP3 branch, as it would conflict with "no general coding style clean up in OMAP3 patches, only OMAP3 related changes, please". Thus, we have to do code style changes for this file at mainline once OMAP3 is merged. Until then we have to stay with consistent local style.

 drivers/i2c/omap24xx_i2c.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

Index: u-boot-arm/drivers/i2c/omap24xx_i2c.c
===================================================================
--- u-boot-arm.orig/drivers/i2c/omap24xx_i2c.c
+++ u-boot-arm/drivers/i2c/omap24xx_i2c.c
@@ -115,7 +115,7 @@ static int i2c_read_byte (u8 devaddr, u8
 		status = wait_for_pin ();
 		if (status & I2C_STAT_RRDY) {
 #if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
-			*value = inb(I2C_DATA);
+			*value = inb (I2C_DATA);
 #else
 			*value = inw (I2C_DATA);
 #endif
@@ -161,13 +161,13 @@ static int i2c_write_byte (u8 devaddr, u
 	if (status & I2C_STAT_XRDY) {
 #if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
 		/* send out 1 byte */
-		outb(regoffset, I2C_DATA);
-		outw(I2C_STAT_XRDY, I2C_STAT);
+		outb (regoffset, I2C_DATA);
+		outw (I2C_STAT_XRDY, I2C_STAT);
 		status = wait_for_pin();
 		if ((status & I2C_STAT_XRDY)) {
 			/* send out next 1 byte */
-			outb(value, I2C_DATA);
-			outw(I2C_STAT_XRDY, I2C_STAT);
+			outb (value, I2C_DATA);
+			outw (I2C_STAT_XRDY, I2C_STAT);
 		} else {
 			i2c_error = 1;
 		}

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-11-09 13:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-04 16:32 [U-Boot] [PATCH-OMAP3] OMAP3: Use I2C file coding style dirk.behme at googlemail.com
2008-11-08 19:09 ` Jean-Christophe PLAGNIOL-VILLARD
2008-11-09  7:38   ` Dirk Behme
2008-11-09 13:18     ` Jean-Christophe PLAGNIOL-VILLARD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox