LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* undefined "pm3fb_setup()"
@ 2007-05-12 10:32 Robert P. J. Day
  2007-05-12 13:57 ` Antonino A. Daplas
  0 siblings, 1 reply; 4+ messages in thread
From: Robert P. J. Day @ 2007-05-12 10:32 UTC (permalink / raw)
  To: Linux Kernel Mailing List


  i'm guessing someone's already spotted this but, with "make
allyesconfig" on x86:

...
  LD      .tmp_vmlinux1
drivers/built-in.o: In function `pm3fb_init':
drivers/video/pm3fb.c:977: undefined reference to `pm3fb_setup'
...

  the reason seems to be this excerpt from drivers/video/pm3fb.c:

================================================================
int __init pm3fb_init(void)
{
        /*
         *  For kernel boot options (in 'video=pm3fb:<options>' format)
         */
#ifndef MODULE                       <-----------------------
        char *option = NULL;

        if (fb_get_options("pm3fb", &option))
                return -ENODEV;
        pm3fb_setup(option);
#endif

        return pci_register_driver(&pm3fb_driver);
}

static void __exit pm3fb_exit(void)
{
        pci_unregister_driver(&pm3fb_driver);
}

#ifdef MODULE                        <------------------------
        /*
         *  Setup
         */

/*
 * Only necessary if your driver takes special options,
 * otherwise we fall back on the generic fb_setup().
 */
int __init pm3fb_setup(char *options)
{
        /* Parse user speficied options (`video=pm3fb:') */
        return 0;
}
#endif /* MODULE */
=================================================================

  so the call to pm3fb_setup() is included if MODULE is *not* defined,
but the actual code for that routine is included if MODULE *is*
defined.  unless i've misread something.

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

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

* Re: undefined "pm3fb_setup()"
  2007-05-12 10:32 undefined "pm3fb_setup()" Robert P. J. Day
@ 2007-05-12 13:57 ` Antonino A. Daplas
  2007-05-12 15:59   ` Robert P. J. Day
  0 siblings, 1 reply; 4+ messages in thread
From: Antonino A. Daplas @ 2007-05-12 13:57 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Linux Kernel Mailing List

On Sat, 2007-05-12 at 06:32 -0400, Robert P. J. Day wrote:
>   i'm guessing someone's already spotted this but, with "make
> allyesconfig" on x86:
> 
> ...
>   LD      .tmp_vmlinux1
> drivers/built-in.o: In function `pm3fb_init':
> drivers/video/pm3fb.c:977: undefined reference to `pm3fb_setup'
> ...
> 
>   the reason seems to be this excerpt from drivers/video/pm3fb.c:
> 
> ================================================================
> int __init pm3fb_init(void)
> {
>         /*
>          *  For kernel boot options (in 'video=pm3fb:<options>' format)
>          */
> #ifndef MODULE                       <-----------------------
>         char *option = NULL;
> 
>         if (fb_get_options("pm3fb", &option))
>                 return -ENODEV;
>         pm3fb_setup(option);
> #endif
> 
>         return pci_register_driver(&pm3fb_driver);
> }
> 
> static void __exit pm3fb_exit(void)
> {
>         pci_unregister_driver(&pm3fb_driver);
> }
> 
> #ifdef MODULE  

I've spotted this before, but forgotten about it.  Yes, the above should
be #ifndef

Tony



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

* Re: undefined "pm3fb_setup()"
  2007-05-12 13:57 ` Antonino A. Daplas
@ 2007-05-12 15:59   ` Robert P. J. Day
  2007-05-12 20:32     ` Antonino A. Daplas
  0 siblings, 1 reply; 4+ messages in thread
From: Robert P. J. Day @ 2007-05-12 15:59 UTC (permalink / raw)
  To: Antonino A. Daplas; +Cc: Linux Kernel Mailing List

On Sat, 12 May 2007, Antonino A. Daplas wrote:

> On Sat, 2007-05-12 at 06:32 -0400, Robert P. J. Day wrote:
> >   i'm guessing someone's already spotted this but, with "make
> > allyesconfig" on x86:
> >
> > ...
> >   LD      .tmp_vmlinux1
> > drivers/built-in.o: In function `pm3fb_init':
> > drivers/video/pm3fb.c:977: undefined reference to `pm3fb_setup'
> > ...
> >
> >   the reason seems to be this excerpt from drivers/video/pm3fb.c:
> >
> > ================================================================
> > int __init pm3fb_init(void)
> > {
> >         /*
> >          *  For kernel boot options (in 'video=pm3fb:<options>' format)
> >          */
> > #ifndef MODULE                       <-----------------------
> >         char *option = NULL;
> >
> >         if (fb_get_options("pm3fb", &option))
> >                 return -ENODEV;
> >         pm3fb_setup(option);
> > #endif
> >
> >         return pci_register_driver(&pm3fb_driver);
> > }
> >
> > static void __exit pm3fb_exit(void)
> > {
> >         pci_unregister_driver(&pm3fb_driver);
> > }
> >
> > #ifdef MODULE
>
> I've spotted this before, but forgotten about it.  Yes, the above should
> be #ifndef

ok, so is someone already fixing this?

rday

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

* Re: undefined "pm3fb_setup()"
  2007-05-12 15:59   ` Robert P. J. Day
@ 2007-05-12 20:32     ` Antonino A. Daplas
  0 siblings, 0 replies; 4+ messages in thread
From: Antonino A. Daplas @ 2007-05-12 20:32 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Linux Kernel Mailing List

On Sat, 2007-05-12 at 11:59 -0400, Robert P. J. Day wrote:
> On Sat, 12 May 2007, Antonino A. Daplas wrote:
> 
> > On Sat, 2007-05-12 at 06:32 -0400, Robert P. J. Day wrote:

> ok, so is someone already fixing this?

Already sent Linus and akpm a patch. 

Thanks.

Tony



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

end of thread, other threads:[~2007-05-12 20:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-12 10:32 undefined "pm3fb_setup()" Robert P. J. Day
2007-05-12 13:57 ` Antonino A. Daplas
2007-05-12 15:59   ` Robert P. J. Day
2007-05-12 20:32     ` Antonino A. Daplas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).