All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RFC] Make asm-generic/ioctl.h extensible by adding conditionals.
@ 2007-02-24 11:45 Robert P. J. Day
  2007-02-24 12:41 ` ioctls.h (Re: [PATCH][RFC] Make asm-generic/ioctl.h extensible by adding conditionals.) Oleg Verych
  0 siblings, 1 reply; 4+ messages in thread
From: Robert P. J. Day @ 2007-02-24 11:45 UTC (permalink / raw)
  To: Linux Kernel Mailing List


  Add some preprocessor checking to asm-generic/ioctl.h to allow other
ioctl.h headers to simply override what are normally trivial
differences.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>

---

  as a followup to my earlier post, is it worth making this change to
allow at least a couple arch-specific ioctl.h files to be massively
simplified?


diff --git a/include/asm-generic/ioctl.h b/include/asm-generic/ioctl.h
index cd02729..e035e6d 100644
--- a/include/asm-generic/ioctl.h
+++ b/include/asm-generic/ioctl.h
@@ -21,8 +21,15 @@
  */
 #define _IOC_NRBITS	8
 #define _IOC_TYPEBITS	8
-#define _IOC_SIZEBITS	14
-#define _IOC_DIRBITS	2
+/*
+ *  Let any architecture override either of the following.
+ */
+#ifndef _IOC_SIZEBITS
+# define _IOC_SIZEBITS	14
+#endif
+#ifndef _IOC_DIRBITS
+# define _IOC_DIRBITS	2
+#endif

 #define _IOC_NRMASK	((1 << _IOC_NRBITS)-1)
 #define _IOC_TYPEMASK	((1 << _IOC_TYPEBITS)-1)
@@ -35,11 +42,17 @@
 #define _IOC_DIRSHIFT	(_IOC_SIZESHIFT+_IOC_SIZEBITS)

 /*
- * Direction bits.
+ * Direction bits, which any architecture can choose to override.
  */
-#define _IOC_NONE	0U
-#define _IOC_WRITE	1U
-#define _IOC_READ	2U
+#ifndef _IOC_NONE
+# define _IOC_NONE	0U
+#endif
+#ifndef _IOC_WRITE
+# define _IOC_WRITE	1U
+#endif
+#ifndef _IOC_READ
+# define _IOC_READ	2U
+#endif

 #define _IOC(dir,type,nr,size) \
 	(((dir)  << _IOC_DIRSHIFT) | \

-- 
========================================================================
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 related	[flat|nested] 4+ messages in thread

* ioctls.h (Re: [PATCH][RFC] Make asm-generic/ioctl.h extensible by adding conditionals.)
  2007-02-24 11:45 [PATCH][RFC] Make asm-generic/ioctl.h extensible by adding conditionals Robert P. J. Day
@ 2007-02-24 12:41 ` Oleg Verych
  2007-02-24 15:59   ` Robert P. J. Day
  0 siblings, 1 reply; 4+ messages in thread
From: Oleg Verych @ 2007-02-24 12:41 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Linux Kernel Mailing List

> From: "Robert P. J. Day"
> Newsgroups: gmane.linux.kernel
> Subject: [PATCH][RFC] Make asm-generic/ioctl.h extensible by adding conditionals.
> Date: Sat, 24 Feb 2007 06:45:20 -0500 (EST)

>   as a followup to my earlier post, is it worth making this change to
> allow at least a couple arch-specific ioctl.h files to be massively
> simplified?

And i wonder, why there is no generic ioctls.h, hm?

____

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

* Re: ioctls.h (Re: [PATCH][RFC] Make asm-generic/ioctl.h extensible by adding conditionals.)
  2007-02-24 12:41 ` ioctls.h (Re: [PATCH][RFC] Make asm-generic/ioctl.h extensible by adding conditionals.) Oleg Verych
@ 2007-02-24 15:59   ` Robert P. J. Day
  2007-02-24 16:30     ` Oleg Verych
  0 siblings, 1 reply; 4+ messages in thread
From: Robert P. J. Day @ 2007-02-24 15:59 UTC (permalink / raw)
  To: Oleg Verych; +Cc: Linux Kernel Mailing List

On Sat, 24 Feb 2007, Oleg Verych wrote:

> > From: "Robert P. J. Day"
> > Newsgroups: gmane.linux.kernel
> > Subject: [PATCH][RFC] Make asm-generic/ioctl.h extensible by adding conditionals.
> > Date: Sat, 24 Feb 2007 06:45:20 -0500 (EST)
>
> >   as a followup to my earlier post, is it worth making this change
> > to allow at least a couple arch-specific ioctl.h files to be
> > massively simplified?
>
> And i wonder, why there is no generic ioctls.h, hm?

beats me, but it seems that there are a *number* of arch-specific
header files that could be treated this way -- a single generic file,
allowing the small number of customizations that seem to be necessary
across all architectures.

but i figured i'd start with ioctl.h first and see where it went from
there.

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

* Re: ioctls.h (Re: [PATCH][RFC] Make asm-generic/ioctl.h extensible by adding conditionals.)
  2007-02-24 15:59   ` Robert P. J. Day
@ 2007-02-24 16:30     ` Oleg Verych
  0 siblings, 0 replies; 4+ messages in thread
From: Oleg Verych @ 2007-02-24 16:30 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Linux Kernel Mailing List

On Sat, Feb 24, 2007 at 10:59:42AM -0500, Robert P. J. Day wrote:
> On Sat, 24 Feb 2007, Oleg Verych wrote:
> 
> > > From: "Robert P. J. Day"
> > > Newsgroups: gmane.linux.kernel
> > > Subject: [PATCH][RFC] Make asm-generic/ioctl.h extensible by adding conditionals.
> > > Date: Sat, 24 Feb 2007 06:45:20 -0500 (EST)
> >
> > >   as a followup to my earlier post, is it worth making this change
> > > to allow at least a couple arch-specific ioctl.h files to be
> > > massively simplified?
> >
> > And i wonder, why there is no generic ioctls.h, hm?
> 
> beats me, but it seems that there are a *number* of arch-specific
> header files that could be treated this way -- a single generic file,
> allowing the small number of customizations that seem to be necessary
> across all architectures.
> 
> but i figured i'd start with ioctl.h first and see where it went from
> there.

Indeed.

Thank you!

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

end of thread, other threads:[~2007-02-24 16:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-24 11:45 [PATCH][RFC] Make asm-generic/ioctl.h extensible by adding conditionals Robert P. J. Day
2007-02-24 12:41 ` ioctls.h (Re: [PATCH][RFC] Make asm-generic/ioctl.h extensible by adding conditionals.) Oleg Verych
2007-02-24 15:59   ` Robert P. J. Day
2007-02-24 16:30     ` Oleg Verych

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.