mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* 2.6.xx - linux/firmware.h - missing include
@ 2004-03-19 15:17 Margit Schubert-While
  2004-03-19 15:30 ` Russell King
  0 siblings, 1 reply; 3+ messages in thread
From: Margit Schubert-While @ 2004-03-19 15:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: ranty

The prototype for request_firmware uses a struct device parameter.
This is only defined if linux/device.h is included.
Fix is simple : include linux/device.h in linux/firmware.h
(Yes, I know we can do the include in a driver, as per the
  example in Documentation;however, the above obviates the need
  for ugly ifdef's for common 2.4/2.6 code and has no downside)
Manuel, can you implement if you agree ?



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

* Re: 2.6.xx - linux/firmware.h - missing include
  2004-03-19 15:17 2.6.xx - linux/firmware.h - missing include Margit Schubert-While
@ 2004-03-19 15:30 ` Russell King
  2004-03-19 18:36   ` Horst von Brand
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King @ 2004-03-19 15:30 UTC (permalink / raw)
  To: Margit Schubert-While; +Cc: linux-kernel, ranty

On Fri, Mar 19, 2004 at 04:17:45PM +0100, Margit Schubert-While wrote:
> The prototype for request_firmware uses a struct device parameter.
> This is only defined if linux/device.h is included.
> Fix is simple : include linux/device.h in linux/firmware.h

That way leads to madness in the includes.  firmware.h does not need
the definition of struct device, it only needs to know that struct
device exists.

You can do this via:

struct device;

before its use - this works much the same way as a function declaration
vs. function prototype.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

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

* Re: 2.6.xx - linux/firmware.h - missing include
  2004-03-19 15:30 ` Russell King
@ 2004-03-19 18:36   ` Horst von Brand
  0 siblings, 0 replies; 3+ messages in thread
From: Horst von Brand @ 2004-03-19 18:36 UTC (permalink / raw)
  To: Russell King; +Cc: Margit Schubert-While, Linux Kernel Mailing List

Russell King <rmk+lkml@arm.linux.org.uk>
> On Fri, Mar 19, 2004 at 04:17:45PM +0100, Margit Schubert-While wrote:
> > The prototype for request_firmware uses a struct device parameter.
> > This is only defined if linux/device.h is included.
> > Fix is simple : include linux/device.h in linux/firmware.h
> 
> That way leads to madness in the includes.  firmware.h does not need
> the definition of struct device, it only needs to know that struct
> device exists.
> 
> You can do this via:
> 
> struct device;
> 
> before its use - this works much the same way as a function declaration
> vs. function prototype.

Iff it is a _pointer_. If it needs a full struct, this won't work. And if
it is a pointer, a simple:

  int foo(struct bar *);

will do for prototype, even if struct bar hasn't been mentioned earlier.

In case the struct is really needed, it is better just to ensure the
respective .h are included in the right order, not nest them.
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

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

end of thread, other threads:[~2004-03-19 18:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-19 15:17 2.6.xx - linux/firmware.h - missing include Margit Schubert-While
2004-03-19 15:30 ` Russell King
2004-03-19 18:36   ` Horst von Brand

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

Powered by JetHome