public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Tim Hockin <thockin@hockin.org>
Cc: Eric Brower <ebrower@usa.net>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ethtool.h should use userspace-accessible types
Date: Thu, 11 Mar 2004 20:57:56 -0800	[thread overview]
Message-ID: <20040312045756.GA30714@kroah.com> (raw)
In-Reply-To: <20040312023551.GA25331@hockin.org>

On Thu, Mar 11, 2004 at 06:35:51PM -0800, Tim Hockin wrote:
> On Thu, Mar 11, 2004 at 05:54:48PM -0800, Eric Brower wrote:
> > Attached is a patch to 2.4's ethtool.h to use appropriate, 
> > userspace-accessible data types (__u8 and friends, rather than u8 and 
> > friends).
> 
> if we *know* the width of them, why don't we just use C99 standard types in
> *both* places?  I've never quite grokked why we need u8 and __u8 and all the
> variants, when we now have uint8_t.  I mean, at least it's standardized.
> 
> Anyone have a logical answer?

Yes.
	u8 means an unsigned 8 bit variable within the kernel.
	__u8 means an unsigned 8 bit variable both within the kernel and
	in userspace.  Use the __ forms when describing data structures
	or variables that cross the userspace/kernelspace boundry in
	order to get everything correct.

Becides, something like u8 is a zillion times saner than uint8_t, don't
you think?  :)

I remember saying that I would document this better a long time ago, as
it comes up every other month or so.  Sorry for not doing it yet...

thanks,

greg k-h

  reply	other threads:[~2004-03-12  4:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-12  1:54 [PATCH] ethtool.h should use userspace-accessible types Eric Brower
2004-03-12  2:35 ` Tim Hockin
2004-03-12  4:57   ` Greg KH [this message]
2004-03-12  9:19     ` Tim Hockin
2004-03-12 16:25 ` Eric W. Biederman
2004-03-12 16:54   ` Jeff Garzik
2004-03-12 17:06     ` Eric W. Biederman
2004-03-12 21:48       ` Jonathan Lundell
2004-03-14  3:25         ` Matt Mackall
2004-03-15 21:24           ` Jonathan Lundell
2004-03-12 16:54 ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040312045756.GA30714@kroah.com \
    --to=greg@kroah.com \
    --cc=ebrower@usa.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thockin@hockin.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox