Subject: conflicting declaration of prom_getcmdline()

From: Ulrich Eckhardt <[email-masked]>
Date: Fri, 1 Apr 2005 10:28:04 +0200

Greetings!

I just stumbled over arch/mips/au1000/common/prom.c, which contains a function 
defined like this:
  char* prom_getcmdline(void);
  EXPORT_SYMBOL(prom_getcmdline);
while there are implementations that define the function as
  char* __init prom_getcmdline();
Further, there are several declarations throughout sourcefiles and in 
include/asm-mips/mips-boards/prom.h and include/asm-mips/sgialib.h. Just grep 
for it and you'll see the mess.

If anyone tells me which one is right and cares to explain why I hereby 
volunteer to create a patch. ;)

Apart from that, some code in arch/mips/au1000/common/prom.c is unnecessarily 
complicated.

cheers

Uli

---

From: Ralf Baechle <[email-masked]>
Date: Mon, 4 Apr 2005 07:21:05 +0100

> volunteer to create a patch. ;)

__init was introduced long after prom_getcmdline() and not all definitions
ever got updated.  For prototypes where __init doesn't server any useful
purpose other than for the human reader so we generally don't use it.

You've herewith been volunteered ;-)

  Ralf

---

From: Geert Uytterhoeven <[email-masked]>
Date: Mon, 4 Apr 2005 13:20:15 +0200 (CEST)

> purpose other than for the human reader so we generally don't use it.

IIRC, there are architectures (alpha?) where __init does matter for prototypes
because a different jump type is used depending on the sections of the caller
and callee.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email-masked]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

---

From: Ralf Baechle <[email-masked]>
Date: Mon, 4 Apr 2005 12:37:03 +0100

> because a different jump type is used depending on the sections of the caller

MIPS gcc doesn't do such optimizations - and we'd expect no advantage from
it either because the range of R_MIPS_26 relocations used for jump
instructions is 256MB - unless somebody hits the special case where this
256MB boundary is going straight through the kernel in which case
-mlong-jump would be required anyway, __init or not.

  Ralf