Linux MIPS Architecture development
 help / color / mirror / Atom feed
* conflicting declaration of prom_getcmdline()
@ 2005-04-01  8:28 Ulrich Eckhardt
  2005-04-04  6:21 ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Eckhardt @ 2005-04-01  8:28 UTC (permalink / raw)
  To: linux-mips

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

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

* Re: conflicting declaration of prom_getcmdline()
  2005-04-01  8:28 conflicting declaration of prom_getcmdline() Ulrich Eckhardt
@ 2005-04-04  6:21 ` Ralf Baechle
  2005-04-04 11:20   ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Ralf Baechle @ 2005-04-04  6:21 UTC (permalink / raw)
  To: Ulrich Eckhardt; +Cc: linux-mips

On Fri, Apr 01, 2005 at 10:28:04AM +0200, Ulrich Eckhardt wrote:

> 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. ;)

__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

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

* Re: conflicting declaration of prom_getcmdline()
  2005-04-04  6:21 ` Ralf Baechle
@ 2005-04-04 11:20   ` Geert Uytterhoeven
  2005-04-04 11:37     ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2005-04-04 11:20 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Ulrich Eckhardt, Linux/MIPS Development

On Mon, 4 Apr 2005, Ralf Baechle wrote:
> On Fri, Apr 01, 2005 at 10:28:04AM +0200, Ulrich Eckhardt wrote:
> > 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. ;)
> 
> __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.

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 -- geert@linux-m68k.org

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

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

* Re: conflicting declaration of prom_getcmdline()
  2005-04-04 11:20   ` Geert Uytterhoeven
@ 2005-04-04 11:37     ` Ralf Baechle
  0 siblings, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2005-04-04 11:37 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Ulrich Eckhardt, Linux/MIPS Development

On Mon, Apr 04, 2005 at 01:20:15PM +0200, Geert Uytterhoeven wrote:

> 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.

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

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

end of thread, other threads:[~2005-04-04 11:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-01  8:28 conflicting declaration of prom_getcmdline() Ulrich Eckhardt
2005-04-04  6:21 ` Ralf Baechle
2005-04-04 11:20   ` Geert Uytterhoeven
2005-04-04 11:37     ` Ralf Baechle

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