Skip to contentSkip to conversation

S5P: serial: Use the inline function instead of static value

PATCH New Minkyu Kang 3 participants 3 messages Jan 24, 2011 – Jan 27, 2011 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/3 S5P: serial: Use the inline function instead of static value

---
 arch/arm/include/asm/arch-s5pc1xx/uart.h |    5 ++++-
 drivers/serial/serial_s5p.c              |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)
arch/arm/include/asm/arch-s5pc1xx/uart.h +4 -1
index f6eeab4..1c56739 100644
@@ -48,7 +48,10 @@ struct s5p_uart {
 	unsigned char	res3[0x3d0];
 };
 
-static int use_divslot = 1;
+static inline int s5p_uart_divslot(void)
+{
+	return 1;
+}
 
 #endif	/* __ASSEMBLY__ */
 
drivers/serial/serial_s5p.c +1 -1
index 9c1cbf4..f1ffa29 100644
@@ -72,7 +72,7 @@ void serial_setbrg_dev(const int dev_index)
 
 	writel(val / 16 - 1, &uart->ubrdiv);
 
-	if (use_divslot)
+	if (s5p_uart_divslot())
 		writew(udivslot[val % 16], &uart->rest.slot);
 	else
 		writeb(val % 16, &uart->rest.value);
Signature · 1 line
1.7.1
#1 lore raw

PATCH v4 1/3 S5P: serial: Use the inline function instead of static value

Quoted 6 lines · Minkyu Kang

---
?arch/arm/include/asm/arch-s5pc1xx/uart.h | ? ?5 ++++- ?drivers/serial/serial_s5p.c ? ? ? ? ? ? ?| ? ?2 +- ?2 files changed, 5 insertions(+), 2 deletions(-)

applied to u-boot-samsung

Minkyu Kang

Signature · 2 lines
from. prom.
www.promsoft.net
#2 lore raw

PATCH v4 1/3 S5P: serial: Use the inline function instead of static value

In reply to Minkyu Kang

Hi Minkyu,

Quoted 33 lines · Minkyu Kang

---
?arch/arm/include/asm/arch-s5pc1xx/uart.h | ? ?5 ++++- ?drivers/serial/serial_s5p.c ? ? ? ? ? ? ?| ? ?2 +- ?2 files changed, 5 insertions(+), 2 deletions(-)

arch/arm/include/asm/arch-s5pc1xx/uart.h +4 -1
index f6eeab4..1c56739 100644
@@ -48,7 +48,10 @@ struct s5p_uart {
 ? ? ? ?unsigned char ? res3[0x3d0];
 ?};
 
-static int use_divslot = 1;
+static inline int s5p_uart_divslot(void)
+{
+ ? ? ? return 1;
+}
 

?#endif /* __ASSEMBLY__ */

drivers/serial/serial_s5p.c +1 -1
index 9c1cbf4..f1ffa29 100644
@@ -72,7 +72,7 @@ void serial_setbrg_dev(const int dev_index)
 
 ? ? ? ?writel(val / 16 - 1, &uart->ubrdiv);
 
- ? ? ? if (use_divslot)
+ ? ? ? if (s5p_uart_divslot())
 ? ? ? ? ? ? ? ?writew(udivslot[val % 16], &uart->rest.slot);
Quoted 2 lines

? ? ? ?else
? ? ? ? ? ? ? ?writeb(val % 16, &uart->rest.value);

Just for my own curiosity, what is the reason behind this?

I would have thought a #define would even work quite nicely.

Regards,

Graeme