public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: Dave Hansen <haveblue@us.ibm.com>,
	xen-devel@lists.xensource.com,
	lkml <linux-kernel@vger.kernel.org>,
	"Mike D. Day" <ncmike@us.ibm.com>
Subject: Re: [Xen-devel] Re: [PATCH 2.6.12.6-xen] sysfs attributes for xen
Date: Mon, 30 Jan 2006 11:33:08 -0800	[thread overview]
Message-ID: <20060130193308.GA18145@kroah.com> (raw)
In-Reply-To: <26c21a6abef89d4629a0da08bc0ba9bf@cl.cam.ac.uk>

On Mon, Jan 30, 2006 at 05:53:30PM +0000, Keir Fraser wrote:
> 
> On 30 Jan 2006, at 17:38, Dave Hansen wrote:
> 
> >Yes, they are.  Buuuuuuut, you _can_ make the code around them a little
> >less evil.  If you _must_ use a typedef, you could do something like
> >this:
> >
> >#define XEN_CAP_INFO_LEN_BYTES 1024
> >typedef char [XEN_CAP_INFO_LEN_BYTES] xen_capabilities_info_t;
> 
> Is that really better than just referencing the typedef? I've always 
> considered them okay for simple scalar and array types, even if they 
> are to be avoided for structure types. Is it the size aspect that is 
> the problem (e.g., a typedef'ed type should be okay to allocate on the 
> stack)?

No, a typedef for a simple array in the kernel is just foolish.  Please
read the archives and my old OLS paper on coding style as to why
typedefs are not acceptable in the kernel, except for a very few core
types (and you should not be creating those types of objects...)

thanks,

greg k-h

      parent reply	other threads:[~2006-01-30 19:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-28  2:20 [PATCH 2.6.12.6-xen] sysfs attributes for xen Mike D. Day
2006-01-28  2:25 ` Greg KH
2006-01-28  2:38 ` Greg KH
2006-01-28 12:23   ` Vincent Hanquez
2006-01-28  3:03 ` [Xen-devel] " Anthony Liguori
2006-01-30 16:18 ` Dave Hansen
2006-01-30 16:58   ` [Xen-devel] " Mike D. Day
2006-01-30 17:04     ` Dave Hansen
2006-01-30 17:17       ` Mike D. Day
2006-01-30 17:26         ` Greg KH
2006-01-30 17:38         ` Dave Hansen
2006-01-30 17:53           ` Keir Fraser
2006-01-30 17:56             ` Dave Hansen
2006-01-30 19:33             ` Greg KH [this message]

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=20060130193308.GA18145@kroah.com \
    --to=greg@kroah.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=haveblue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ncmike@us.ibm.com \
    --cc=xen-devel@lists.xensource.com \
    /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