mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@mindspring.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	matthew@wil.cx
Subject: Re: [PATCH] Make asm-generic/ioctl.h more generic using conditionals.
Date: Thu, 12 Jul 2007 20:51:35 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0707122044400.12963@localhost.localdomain> (raw)
In-Reply-To: <20070712161146.78e078b5.akpm@linux-foundation.org>


On Thu, 12 Jul 2007, Andrew Morton wrote:

> On Tue, 10 Jul 2007 06:33:26 -0400 (EDT)
> "Robert P. J. Day" <rpjday@mindspring.com> wrote:
>
> >
> > Allow individual architectures to override a small set of macros
> > before including asm-generic/ioctl.h, in order to greatly simplify a
> > number of existing ioctl.h files.
> >
> > The overrideable macros would be:
> >
> > 	_IOC_SIZEBITS
> > 	_IOC_DIRBITS
> > 	_IOC_NONE
> > 	_IOC_WRITE
> > 	_IOC_READ
> >
> > ---
> >
> >   i've submitted this once before, and it didn't seem to garner a
> > lot of attention one way or the other.  this patch can be applied
> > standalone and shouldn't affect anything, but it would
> > subsequently allow at least a few ioctl.h files to be shortened
> > considerably.
>
> It would be good if we could see one of these followon patches.  If
> such an example patch (cc'ed to the arch maintainer, please) looks
> OK then we can go ahead with this base patch.

as a trivial example, i can demonstrate on include/asm-mips/ioctl.h.
once the generic ioctl.h file is enhanced, then the entire mips
ioctl.h file is reduced from 94 lines to:

===================================
#define _IOC_SIZEBITS	13
#define _IOC_DIRBITS	3

#define _IOC_NONE	1U
#define _IOC_READ	2U
#define _IOC_WRITE	4U

#include <asm-generic/ioctl.h>

/*
 * The following are included for compatibility
 */

#define _IOC_VOID	0x20000000
#define _IOC_OUT	0x40000000
#define _IOC_IN		0x80000000
#define _IOC_INOUT	(IOC_IN|IOC_OUT)
=================================

and the last part of that is purely MIPS-specific content.

  there are at least a couple other ioctl.h files that could be
reduced even further.  asm-parisc/ioctl.h would subsequently become
all of four lines:

=================================
#define _IOC_NONE	0U   (this line isn't even necessary)
#define _IOC_WRITE	2U
#define _IOC_READ	1U

#include <asm-generic/ioctl.h>
=================================

etc, etc.

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

  reply	other threads:[~2007-07-13  0:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-10 10:33 Robert P. J. Day
2007-07-12 23:11 ` Andrew Morton
2007-07-13  0:51   ` Robert P. J. Day [this message]
2007-07-13  9:56 ` Christoph Hellwig
2007-07-13  9:58   ` Robert P. J. Day

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=Pine.LNX.4.64.0707122044400.12963@localhost.localdomain \
    --to=rpjday@mindspring.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=ralf@linux-mips.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

all inboxes | Powered by JetHome®