Skip to contentSkip to conversation

sparc: prom: Merge console_*.c into printf.c

RFC In review Julian Calaby 2 participants 3 messages Dec 4, 2010 – Dec 12, 2010 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

RFC 5/8 sparc: prom: Merge console_*.c into printf.c

prom_console_write_buf() is only used in prom/printf.c, so as it's the only remaining function in console_*.c, let's merge console_*.c into printf.c.

We'll also rename prom_nbputchar() to __prom_console_write_buf() and merge the definitions of prom_console_write_buf() as they're identical.

---
 arch/sparc/prom/Makefile     |    1 -
 arch/sparc/prom/console_32.c |   56 ---------------------------------
 arch/sparc/prom/console_64.c |   48 ----------------------------
 arch/sparc/prom/printf.c     |   71 ++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 69 insertions(+), 107 deletions(-)
 delete mode 100644 arch/sparc/prom/console_32.c
 delete mode 100644 arch/sparc/prom/console_64.c
arch/sparc/prom/Makefile +0 -1
index 816c0fa..cf14bbf 100644
@@ -13,7 +13,6 @@ lib-$(CONFIG_SPARC32) += mp.o
 lib-$(CONFIG_SPARC32) += palloc.o
 lib-$(CONFIG_SPARC32) += ranges.o
 lib-$(CONFIG_SPARC32) += segment.o
-lib-y                 += console_$(BITS).o
 lib-y                 += printf.o
 lib-y                 += tree_$(BITS).o
 lib-$(CONFIG_SPARC64) += p1275.o
arch/sparc/prom/console_32.c deleted +0 -56

56 lines not on this page · raw message

arch/sparc/prom/console_64.c deleted +0 -48

48 lines not on this page · raw message

arch/sparc/prom/printf.c +69 -2

83 lines not on this page · raw message

maintainer
#1 lore raw

From: Julian Calaby <[email protected]>
Date: Sat, 04 Dec 2010 14:57:47 +1100

Quoted 9 lines

prom_console_write_buf() is only used in prom/printf.c, so as it's the only remaining function in console_*.c, let's merge console_*.c into printf.c.

We'll also rename prom_nbputchar() to __prom_console_write_buf() and merge the definitions of prom_console_write_buf() as they're identical.

This doesn't make sense.

The whole idea is that when there is a 32-bit and 64-bit implementation of the same interface, we have foo_32.c and foo_64.c to implement them which is exactly what is happening here.

#2 lore raw
In reply to Julian Calaby
Quoted 11 lines · David Miller

From: Julian Calaby <[email protected]>
Date: Sat, 04 Dec 2010 14:57:47 +1100

Quoted 8 lines

prom_console_write_buf() is only used in prom/printf.c, so as it's the only remaining function in console_*.c, let's merge console_*.c into printf.c.

We'll also rename prom_nbputchar() to __prom_console_write_buf() and merge the definitions of prom_console_write_buf() as they're identical.

Quoted 7 lines
Quoted 1 line

This doesn't make sense.

The whole idea is that when there is a 32-bit and 64-bit implementation of the same interface, we have foo_32.c and foo_64.c to implement them which is exactly what is happening here.

Fair enough.

The reason for these changes were that I feel that having two files for one function is a little excessive - hence this move.

But that said, #ifdefs are also evil.

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/