public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* When to use mtd.h or mtd-user.h
@ 2007-05-15 15:09 MikeW
  2007-05-15 15:14 ` Josh Boyer
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: MikeW @ 2007-05-15 15:09 UTC (permalink / raw)
  To: linux-mtd

I note some applications for running in userspace say:
#include <linux/mtd/mtd.h>
and some say
#include <mtd/mtd-user.h>

Which is the recommended usage, and why ?

Many thanks,
MikeW

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

* Re: When to use mtd.h or mtd-user.h
  2007-05-15 15:09 When to use mtd.h or mtd-user.h MikeW
@ 2007-05-15 15:14 ` Josh Boyer
  2007-05-15 15:21 ` Robert P. J. Day
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Josh Boyer @ 2007-05-15 15:14 UTC (permalink / raw)
  To: MikeW; +Cc: linux-mtd

On 5/15/07, MikeW <mw_phil@yahoo.co.uk> wrote:
> I note some applications for running in userspace say:
> #include <linux/mtd/mtd.h>

Er, which ones?  I don't see anything in mtd-utils that does that.

> and some say
> #include <mtd/mtd-user.h>
>
> Which is the recommended usage, and why ?

mtd-user.h because it's been sanitized for inclusion in userspace.

josh

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

* Re: When to use mtd.h or mtd-user.h
  2007-05-15 15:09 When to use mtd.h or mtd-user.h MikeW
  2007-05-15 15:14 ` Josh Boyer
@ 2007-05-15 15:21 ` Robert P. J. Day
  2007-05-15 15:48   ` MikeW
  2007-05-16  9:54 ` MikeW
  2007-05-17 10:09 ` Wolfgang Denk
  3 siblings, 1 reply; 9+ messages in thread
From: Robert P. J. Day @ 2007-05-15 15:21 UTC (permalink / raw)
  To: MikeW; +Cc: linux-mtd

On Tue, 15 May 2007, MikeW wrote:

> I note some applications for running in userspace say:
> #include <linux/mtd/mtd.h>
> and some say
> #include <mtd/mtd-user.h>
>
> Which is the recommended usage, and why ?

i'm not even sure where that first header file would be coming from.
it's not part of glibc, and it's not created as part of the sanitized
headers by the kernel.  are you sure you've seen that in someone's
*userspace* code?  and the inclusion worked?

in any event, it's that second header file that's correct.

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] 9+ messages in thread

* Re: When to use mtd.h or mtd-user.h
  2007-05-15 15:21 ` Robert P. J. Day
@ 2007-05-15 15:48   ` MikeW
  0 siblings, 0 replies; 9+ messages in thread
From: MikeW @ 2007-05-15 15:48 UTC (permalink / raw)
  To: linux-mtd

Robert P. J. Day <rpjday <at> mindspring.com> writes:

> 
> 
> i'm not even sure where that first header file would be coming from.
> it's not part of glibc, and it's not created as part of the sanitized
> headers by the kernel.  are you sure you've seen that in someone's
> *userspace* code?  and the inclusion worked?
> 
> in any event, it's that second header file that's correct.
> 
> rday

The line #include <linux/mtd/mtd.h> is taken from uboot/tools/env/fw_env.c
from www.denx.de (v.1.1.4)

There's another usage in openwrt/package/mtd/mtd.c

Both are intended to run as userspace apps.
However, making the mtd-user.h patch allows them to build without complaint.

Thanks,
MikeW

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

* Re: When to use mtd.h or mtd-user.h
  2007-05-15 15:09 When to use mtd.h or mtd-user.h MikeW
  2007-05-15 15:14 ` Josh Boyer
  2007-05-15 15:21 ` Robert P. J. Day
@ 2007-05-16  9:54 ` MikeW
  2007-05-16 10:11   ` Artem Bityutskiy
  2007-05-17 10:09 ` Wolfgang Denk
  3 siblings, 1 reply; 9+ messages in thread
From: MikeW @ 2007-05-16  9:54 UTC (permalink / raw)
  To: linux-mtd

MikeW <mw_phil <at> yahoo.co.uk> writes:

> 
> I note some applications for running in userspace say:
> #include <linux/mtd/mtd.h>
> and some say
> #include <mtd/mtd-user.h>
> 
> Which is the recommended usage, and why ?
> 
> Many thanks,
> MikeW

Incidentally, I did actually realise which was the *correct* usage,
but I wondered why anyone (especially uBoot) would use the other.

Thanks for the comments,
MikeW

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

* Re: When to use mtd.h or mtd-user.h
  2007-05-16  9:54 ` MikeW
@ 2007-05-16 10:11   ` Artem Bityutskiy
  2007-05-16 10:34     ` MikeW
  0 siblings, 1 reply; 9+ messages in thread
From: Artem Bityutskiy @ 2007-05-16 10:11 UTC (permalink / raw)
  To: MikeW; +Cc: linux-mtd

On Wed, 2007-05-16 at 09:54 +0000, MikeW wrote:
> Incidentally, I did actually realise which was the *correct* usage,
> but I wondered why anyone (especially uBoot) would use the other.

Because most people send questions but not patches :-) ?

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

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

* Re: When to use mtd.h or mtd-user.h
  2007-05-16 10:11   ` Artem Bityutskiy
@ 2007-05-16 10:34     ` MikeW
  2007-05-16 14:00       ` Artem Bityutskiy
  0 siblings, 1 reply; 9+ messages in thread
From: MikeW @ 2007-05-16 10:34 UTC (permalink / raw)
  To: linux-mtd

Artem Bityutskiy <dedekind <at> infradead.org> writes:

> 
> On Wed, 2007-05-16 at 09:54 +0000, MikeW wrote:
> > Incidentally, I did actually realise which was the *correct* usage,
> > but I wondered why anyone (especially uBoot) would use the other.
> 
> Because most people send questions but not patches  ?
> 

Trouble is, the people with the questions do not usually consider
themselves authoritative enough to send in a patch, since they
feel (possibly correctly!) that they do not know the system
well enough to be aware of implications of what on the face of
it might be a simple 'correction'.

In which case, those who *are* authoritative may, if they have the
time and inclination, pick up on the issue and make the correction!

But I would submit patches if I felt sufficiently knowledgeable
in the relevant area of code.

Regards,
MikeW (мАйк)

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

* Re: When to use mtd.h or mtd-user.h
  2007-05-16 10:34     ` MikeW
@ 2007-05-16 14:00       ` Artem Bityutskiy
  0 siblings, 0 replies; 9+ messages in thread
From: Artem Bityutskiy @ 2007-05-16 14:00 UTC (permalink / raw)
  To: MikeW; +Cc: linux-mtd

On Wed, 2007-05-16 at 10:34 +0000, MikeW wrote:
> In which case, those who *are* authoritative may, if they have the
> time and inclination, pick up on the issue and make the correction!

But now when you know which header is correct, you could send a patch to
uBoot. Also, when you got some answers to some questions, you could send
a patch against mtd-www.git and add a FAQ entry. And so on. :-)

> Regards,
> MikeW (мАйк)
:-) МайкВ

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

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

* Re: When to use mtd.h or mtd-user.h
  2007-05-15 15:09 When to use mtd.h or mtd-user.h MikeW
                   ` (2 preceding siblings ...)
  2007-05-16  9:54 ` MikeW
@ 2007-05-17 10:09 ` Wolfgang Denk
  3 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2007-05-17 10:09 UTC (permalink / raw)
  To: MikeW; +Cc: linux-mtd

In message <loom.20070515T170629-855@post.gmane.org> you wrote:
> I note some applications for running in userspace say:
> #include <linux/mtd/mtd.h>
> and some say
> #include <mtd/mtd-user.h>
> 
> Which is the recommended usage, and why ?

<linux/mtd/mtd.h> used to be used on very old (2.4) kernel versions;
<mtd/mtd-user.h> has to be used now.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
The biggest difference between time and space is that you can't reuse
time.                                                 - Merrick Furst

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

end of thread, other threads:[~2007-05-17 10:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-15 15:09 When to use mtd.h or mtd-user.h MikeW
2007-05-15 15:14 ` Josh Boyer
2007-05-15 15:21 ` Robert P. J. Day
2007-05-15 15:48   ` MikeW
2007-05-16  9:54 ` MikeW
2007-05-16 10:11   ` Artem Bityutskiy
2007-05-16 10:34     ` MikeW
2007-05-16 14:00       ` Artem Bityutskiy
2007-05-17 10:09 ` Wolfgang Denk

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