public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tiny patch to kill warning in drivers/ide/ide.c
@ 2004-06-09  1:38 Jesper Juhl
  2004-06-09  2:33 ` Andreas Dilger
  2004-06-09 10:31 ` Bartlomiej Zolnierkiewicz
  0 siblings, 2 replies; 5+ messages in thread
From: Jesper Juhl @ 2004-06-09  1:38 UTC (permalink / raw)
  To: B.Zolnierkiewicz; +Cc: linux-kernel, linux-ide


To kill this warning :

drivers/ide/ide.c: In function `ide_unregister_subdriver':
drivers/ide/ide.c:2216: warning: implicit declaration of function `pnpide_init'

I added a simple declaration of pnpide_init to drivers/ide/ide.c

Here's a patch against 2.6.7-rc3 - please consider including it (or if
that's not the way to do it, then don't) :)


--- linux-2.6.7-rc3-orig/drivers/ide/ide.c	2004-06-09 03:34:49.000000000 +0200
+++ linux-2.6.7-rc3/drivers/ide/ide.c	2004-06-09 03:31:29.000000000 +0200
@@ -198,6 +198,7 @@ EXPORT_SYMBOL(ide_hwifs);

 extern ide_driver_t idedefault_driver;
 static void setup_driver_defaults(ide_driver_t *driver);
+void pnpide_init(int enable);

 /*
  * Do not even *think* about calling this!


--
Jesper Juhl <juhl-lkml@dif.dk>


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

* Re: [PATCH] tiny patch to kill warning in drivers/ide/ide.c
  2004-06-09  1:38 [PATCH] tiny patch to kill warning in drivers/ide/ide.c Jesper Juhl
@ 2004-06-09  2:33 ` Andreas Dilger
  2004-06-09 14:37   ` Jesper Juhl
  2004-06-09 10:31 ` Bartlomiej Zolnierkiewicz
  1 sibling, 1 reply; 5+ messages in thread
From: Andreas Dilger @ 2004-06-09  2:33 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: B.Zolnierkiewicz, linux-kernel, linux-ide

[-- Attachment #1: Type: text/plain, Size: 903 bytes --]

On Jun 09, 2004  03:38 +0200, Jesper Juhl wrote:
> drivers/ide/ide.c: In function `ide_unregister_subdriver':
> drivers/ide/ide.c:2216: warning: implicit declaration of function `pnpide_init'
> 
> I added a simple declaration of pnpide_init to drivers/ide/ide.c
> 
> Here's a patch against 2.6.7-rc3 - please consider including it (or if
> that's not the way to do it, then don't) :)

Better to add the declaration into a header like linux/ide.h that is
included into both ide.c and ide-pnp.c so that when/if pnpide_init()
ever changes its prototype you will get a warning during compilation.

The only good reason to have declarations within .c files is for forward
declarations of functions only used in the same file.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://members.shaw.ca/adilger/                 http://members.shaw.ca/golinux/


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH] tiny patch to kill warning in drivers/ide/ide.c
  2004-06-09  1:38 [PATCH] tiny patch to kill warning in drivers/ide/ide.c Jesper Juhl
  2004-06-09  2:33 ` Andreas Dilger
@ 2004-06-09 10:31 ` Bartlomiej Zolnierkiewicz
  2004-06-09 14:39   ` Jesper Juhl
  1 sibling, 1 reply; 5+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2004-06-09 10:31 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: linux-kernel, linux-ide

On Wednesday 09 of June 2004 03:38, Jesper Juhl wrote:
> To kill this warning :
>
> drivers/ide/ide.c: In function `ide_unregister_subdriver':
> drivers/ide/ide.c:2216: warning: implicit declaration of function
> `pnpide_init'
>
> I added a simple declaration of pnpide_init to drivers/ide/ide.c
>
> Here's a patch against 2.6.7-rc3 - please consider including it (or if
> that's not the way to do it, then don't) :)

Thanks but the real bug is to call pnpide_init() from
ide_unregister_subdriver(), I'll push ide-pnp update soon.


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

* Re: [PATCH] tiny patch to kill warning in drivers/ide/ide.c
  2004-06-09  2:33 ` Andreas Dilger
@ 2004-06-09 14:37   ` Jesper Juhl
  0 siblings, 0 replies; 5+ messages in thread
From: Jesper Juhl @ 2004-06-09 14:37 UTC (permalink / raw)
  To: Andreas Dilger; +Cc: B.Zolnierkiewicz, linux-kernel, linux-ide

On Wed, 9 Jun 2004, Andreas Dilger wrote:

> On Jun 09, 2004  03:38 +0200, Jesper Juhl wrote:
> > drivers/ide/ide.c: In function `ide_unregister_subdriver':
> > drivers/ide/ide.c:2216: warning: implicit declaration of function
> `pnpide_init'
> >
> > I added a simple declaration of pnpide_init to drivers/ide/ide.c
> >
> > Here's a patch against 2.6.7-rc3 - please consider including it (or if
> > that's not the way to do it, then don't) :)
> Better to add the declaration into a header like linux/ide.h that is
> included into both ide.c and ide-pnp.c so that when/if pnpide_init()
> ever changes its prototype you will get a warning during compilation.
> The only good reason to have declarations within .c files is for forward
> declarations of functions only used in the same file.

That makes perfect sense. I actually considered making a header for it,
but since it would contain only a single declaration I abandoned that - I
see now that I should have done that in any case to avoid stuff becomming
out of sync.

Would you like an updated patch ?


--
Jesper Juhl <juhl@dif.dk>


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

* Re: [PATCH] tiny patch to kill warning in drivers/ide/ide.c
  2004-06-09 10:31 ` Bartlomiej Zolnierkiewicz
@ 2004-06-09 14:39   ` Jesper Juhl
  0 siblings, 0 replies; 5+ messages in thread
From: Jesper Juhl @ 2004-06-09 14:39 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-kernel, linux-ide, Andreas Dilger

On Wed, 9 Jun 2004, Bartlomiej Zolnierkiewicz wrote:

> On Wednesday 09 of June 2004 03:38, Jesper Juhl wrote:
> > To kill this warning :
> >
> > drivers/ide/ide.c: In function `ide_unregister_subdriver':
> > drivers/ide/ide.c:2216: warning: implicit declaration of function
> > `pnpide_init'
> >
> > I added a simple declaration of pnpide_init to drivers/ide/ide.c
> >
> > Here's a patch against 2.6.7-rc3 - please consider including it (or if
> > that's not the way to do it, then don't) :)
>
> Thanks but the real bug is to call pnpide_init() from
> ide_unregister_subdriver(), I'll push ide-pnp update soon.
>

Ok, in that case I will leave it alone and just wait for your update.


--
Jesper Juhl <juhl@dif.dk>


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

end of thread, other threads:[~2004-06-09 14:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-09  1:38 [PATCH] tiny patch to kill warning in drivers/ide/ide.c Jesper Juhl
2004-06-09  2:33 ` Andreas Dilger
2004-06-09 14:37   ` Jesper Juhl
2004-06-09 10:31 ` Bartlomiej Zolnierkiewicz
2004-06-09 14:39   ` Jesper Juhl

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